@voiceflow/common
Version:
Junk drawer of utility functions
12 lines (11 loc) • 346 B
JavaScript
import { MurmurHash3 } from 'murmurhash-wasm';
import { hex2abc } from './hex2abc.js';
export class MurmurHash {
static hash(key, seed = 0) {
const hash = MurmurHash3.hash32(key, seed);
const value = hash.readUInt32BE(0);
const hex = value.toString(16);
return hex2abc(hex);
}
}
export default MurmurHash;