MCPcopy Create free account
hub / github.com/apache/fory / x64mix128

Function x64mix128

javascript/packages/core/lib/murmurHash3.ts:150–170  ·  view source on GitHub ↗
(h1: u64, h2: u64, k1: u64, k2: u64)

Source from the content-addressed store, hash-verified

148const x64hash128c2: u64 = [0x4cf5ad43, 0x2745937f];
149
150function x64mix128(h1: u64, h2: u64, k1: u64, k2: u64): [u64, u64] {
151 k1 = mul64(k1, x64hash128c1);
152 k1 = rol64(k1, 31);
153 k1 = mul64(k1, x64hash128c2);
154 h1 = xor64(h1, k1);
155
156 h1 = rol64(h1, 27);
157 h1 = add64(h1, h2);
158 h1 = add64(mul64(h1, [0x0, 5]), [0x0, 0x52dce729]);
159
160 k2 = mul64(k2, x64hash128c2);
161 k2 = rol64(k2, 33);
162 k2 = mul64(k2, x64hash128c1);
163 h2 = xor64(h2, k2);
164
165 h2 = rol64(h2, 31);
166 h2 = add64(h2, h1);
167 h2 = add64(mul64(h2, [0x0, 5]), [0x0, 0x38495ab5]);
168
169 return [h1, h2];
170}
171
172export type x64hash128State = {
173 h1: u64,

Callers 1

x64hash128Function · 0.85

Calls 4

mul64Function · 0.85
rol64Function · 0.85
xor64Function · 0.85
add64Function · 0.85

Tested by

no test coverage detected