diff --git a/strings.go b/strings.go index 8278683..14757fe 100644 --- a/strings.go +++ b/strings.go @@ -6,6 +6,18 @@ import ( "strings" ) +// BuildWhitelistForStringSanitisation transfroms a slice of whitelisted substrings into a hashtable +func BuildWhitelistForStringSanitisation(wl []string) map[string]string { + whitelist := map[string]string{} + + for _, c := range wl { + whitelist[c] = c + } + + return whitelist + +} + // FirstCharacterToUppercase converts the first character of a string to uppercase func FirstCharacterToUppercase(s string) string { if len(s) == 0 {