murmurHash

Murmur3 32-bit hashing helpers over raw byte storage.


murmur32Scramble (value -- scrambled)

Applies the Murmur3 32-bit block scrambling step to one Nat32 value.


murmur3_32 (key size seed -- hash)

Computes one 32-bit Murmur3 hash over raw byte storage.


Input model


Seed and result


Examples

Scramble step

"murmurHash" use
"control" use

{} () {} [
  0n32 murmur32Scramble printStack _:;
  1n32 murmur32Scramble printStack _:;
] "main" exportFunction

Expected Output During Compilation

0n32
3277036125n32

Zero-size input

"murmurHash" use
"control" use

{} () {} [
  0nx 0 0n32 murmur3_32 printStack _:;
  0nx 0 1n32 murmur3_32 printStack _:;
] "main" exportFunction

Expected Output During Compilation

0n32
1364076727n32

Whole input and seed effect

"murmurHash" use
"String" use
"control" use

{} Int32 {} [
  (97n8 98n8 99n8) storageAddress 3 0n32 murmur3_32 toString print
  "\n" print
  (97n8 98n8 99n8) storageAddress 3 1n32 murmur3_32 toString print
  0
] "main" exportFunction

Expected Output

3017643002
2859854335

See also