The key to hash
The seed to use to hash
The hash in a Buffer
containing a single unsigned 32-bit integer in big-endian format (UInt32BE)
import { MurmurHash3 } from 'murmurhash-wasm';
const key = Buffer.from('hello');
const seed = 0;
const hash = MurmurHash3.hash32(key, seed);
const hex = hash.toString('hex');
// '5844da46'
const value = hash.readUInt32BE();
// 1480907334
Hashes a provided key with a seed using the MurmurHash3 algorithm yielding a 32-bit hash.
The key will be converted to a Buffer
using Buffer.from()
.
The key to hash
The seed to use to hash
The hash in a Buffer
containing a single unsigned 32-bit integer in big-endian format (UInt32BE)
import { MurmurHash3 } from 'murmurhash-wasm';
const key = 'hello';
const seed = 0;
const hash = MurmurHash3.hash32(key, seed);
const hex = hash.toString('hex');
// '5844da46'
const value = hash.readUInt32BE();
// 1480907334
Generated using TypeDoc
Hashes a provided key with a seed using the MurmurHash3 algorithm yielding a 32-bit hash.