feature: Adds semi-broken stability improvements into the runtime environment.

This commit is contained in:
Tera << 8 2025-01-05 23:45:44 -05:00
parent f505ff6605
commit 605ad31dd6
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
3 changed files with 205 additions and 35 deletions

View file

@ -67,16 +67,21 @@ type BackupData struct {
}
// From https://stackoverflow.com/questions/54461423/efficient-way-to-remove-all-non-alphanumeric-characters-from-large-text
// Strips all alphanumeric characters from a string
func stripAllAlphanumeric(s string) string {
var result strings.Builder
for i := 0; i < len(s); i++ {
b := s[i]
if ('a' <= b && b <= 'z') ||
('A' <= b && b <= 'Z') ||
('0' <= b && b <= '9') {
result.WriteByte(b)
} else {
result.WriteByte('_')
}
}
return result.String()
}