@wtasnorg/node-lib / hashString
hashString(
input,salt?,size?):number
Defined in: src/hash.ts:48
Compute a simple non-cryptographic hash of a string value.
The algorithm converts the input to its ASCII-code string representation,
pads it to size characters using salt, then reduces it to a single
numeric hash via a weighted sum of character codes.
unknown
The value to hash (converted to string).
string
Padding string (defaults to lowercase alphabet).
number
Target length for the padded intermediate string (defaults to 26).
number
A numeric hash value.
hashString("hello"); // deterministic numeric result
hashString("hello", "xyz", 10);