UNPKG

@voiceflow/common

Version:

Junk drawer of utility functions

16 lines (15 loc) 521 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MurmurHash = void 0; const murmurhash_wasm_1 = require("murmurhash-wasm"); const hex2abc_1 = require("./hex2abc"); class MurmurHash { static hash(key, seed = 0) { const hash = murmurhash_wasm_1.MurmurHash3.hash32(key, seed); const value = hash.readUInt32BE(0); const hex = value.toString(16); return (0, hex2abc_1.hex2abc)(hex); } } exports.MurmurHash = MurmurHash; exports.default = MurmurHash;