Murmur3 32-bit hashing helpers over raw byte storage.


murmur32Scramble

(value -- value) Applies the Murmur3 32-bit block scramble.

murmur3_32

(key size seed -- hash) Hashes raw bytes with Murmur3 x86 32-bit finalization.

The helper is one-shot; there is no incremental interface (compare sha1).

Input model

Pass a Natx address and a byte count; the module has no Text or StringView overload.



Examples

Scramble step

"control"    use
"murmurHash" use

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

Expected Output During Compilation

0n32
3277036125n32

Zero-size input

"control"    use
"murmurHash" 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

"String"     use
"control"    use
"murmurHash" 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