Normalize strings to avoid encoding pitfalls
masterAll algorithms in hash-wasm depend on the binary representation of the input string. Because different Unicode sequences can represent the same character (e.g., \u00fc vs u\u0308), you should normalize your strings before hashing to ensure consistent results.
It is highly recommended to use the built-in String.prototype.normalize() method, specifically with the "NFKC" form, before encoding with TextEncoder.
// Example of normalization
const te = new TextEncoder();
const str1 = "u\u0308";
const str2 = "\u00fc";
// Without normalization, these might produce different hashes
te.encode(str1.normalize("NFKC"));
te.encode(str2.normalize("NFKC"));