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

Function add64

javascript/packages/core/lib/murmurHash3.ts:30–51  ·  view source on GitHub ↗
(m: u64, n: u64)

Source from the content-addressed store, hash-verified

28
29
30function add64(m: u64, n: u64): u64 {
31 const ms: u64spill = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];
32 const ns: u64spill = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];
33 const os: u64spill = [0x0, 0x0, 0x0, 0x0];
34
35 os[3] += ms[3] + ns[3];
36 os[2] += os[3] >>> 16;
37 os[3] &= 0xffff;
38
39 os[2] += ms[2] + ns[2];
40 os[1] += os[2] >>> 16;
41 os[2] &= 0xffff;
42
43 os[1] += ms[1] + ns[1];
44 os[0] += os[1] >>> 16;
45 os[1] &= 0xffff;
46
47 os[0] += ms[0] + ns[0];
48 os[0] &= 0xffff;
49
50 return [(os[0] << 16) | os[1], (os[2] << 16) | os[3]];
51}
52
53function mul64(m: u64, n: u64): u64 {
54 const ms: u64spill = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];

Callers 2

x64mix128Function · 0.85
x64hash128Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected