Spookyhash
Bob Jenkins's 128-bit non-cryptographic hash for 64-bit machines
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Spookyhash
Spookyhash is a checksum / non-cryptographic hash. It produces a 16-byte (128-bit) output. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
SpookyHash is a non-cryptographic hash function by Bob Jenkins, released in 2011. It produces a 128-bit hash and is designed for speed on 64-bit processors with long inputs. It provides no security against a deliberate attacker.
SpookyHash keeps twelve 64-bit state variables and consumes input in 96-byte blocks, mixing each block in with additions, XORs and rotations. Short inputs use a separate, faster routine with four state variables. The 128-bit result can be truncated to 64 or 32 bits. It favours long inputs. It is fast on x86-64.
NextSSL includes SpookyHash wired from source and not yet verified against the reference implementation. SpookyHash version 1 and version 2 produce different results for some inputs. None of this provides security: the function has no secret key, and anyone can compute or deliberately collide its outputs. Record the version used.
History
2011–2011SpookyHash published by Bob Jenkins
Security notes
SpookyHash is not cryptographic and makes no claim of resistance to deliberately constructed collisions. Use it only on trusted data.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 16 | Output |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
value = root.call("checksum", "spookyhash", None, b"123456789")[0]
nextssl_root_checksum("spookyhash", NULL, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_checksum_in(reg::all(), Policy::Any, "spookyhash", &Params::new())?;
let value = alg.checksum(b"123456789")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?More checksums and non-cryptographic hashes
All 130Frequently asked questions
What is Spookyhash?
Spookyhash is a checksum in the SpookyHash family. SpookyHash is a non-cryptographic hash function by Bob Jenkins, released in 2011.
What are the Spookyhash sizes?
In NextSSL, Spookyhash uses: output 16 bytes.
Who designed Spookyhash and when?
Spookyhash belongs to the SpookyHash family, first published in 2011 by Bob Jenkins.
Is Spookyhash safe to use?
Spookyhash is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).