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

Function shl64

javascript/packages/core/lib/murmurHash3.ts:108–119  ·  view source on GitHub ↗
(n: u64, s: number)

Source from the content-addressed store, hash-verified

106}
107
108function shl64(n: u64, s: number): u64 {
109 s %= 64;
110
111 // istanbul ignore if: here for completeness but never used.
112 if (s === 0) {
113 return n;
114 } else if (s < 32) {
115 return [(n[0] << s) | (n[1] >>> (32 - s)), n[1] << s];
116 } else {
117 return [n[1] << (s - 32), 0x0];
118 }
119}
120
121function xor64(a: u64, b: u64): u64 {
122 return [a[0] ^ b[0], a[1] ^ b[1]];

Callers 1

x64hash128Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected