FNV-1a Hash

Fast non-cryptographic hash function.

Code

Utilities
let hash = 2166136261;
for (let i = 0; i < str.length; i++) {
  hash ^= str.charCodeAt(i);
  hash = Math.imul(hash, 16777619);
}
return (hash >>> 0).toString();

Parameters

String to hash.

Browser·fetch() may be limited by CORS

More JavaScript Snippets