A TypeScript implementation of unsigned 32-bit MurmurHash3.
This function provides the MurmurHash3 value for a string key.
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import { murmurHash3 } from "https://deno.land/x/murmur_hash_3/mod.ts";
const hash = murmurHash3("deno");
assertEquals(hash, 3565573943);
A seed can be provided with the options parameter. The default seed is 0.
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import { murmurHash3 } from "https://deno.land/x/murmur_hash_3/mod.ts";
const hash = murmurHash3("deno", { seed: 42 });
assertEquals(hash, 3140446342);
Feel free to contribute.