Ejemplo n.º 1
0
        public static string HashWords(this string text, byte[] key)
        {
            if (text == null || key == null)
            {
                return(text);
            }

            using var hmac = new HMACMD5(key);
            return(WordRegex.Replace(text, match => hmac.HashWord(match.Value.ToLower())));
        }
Ejemplo n.º 2
0
 private static string EscapeKeywords(this string text)
 => text == null ? null : WordRegex.Replace(text, match => match.Value.EscapeKeyword());