Registry / database / spookyhash

spookyhash

JSON →
library2.1.1pypypi✓ verified 83d ago

A Python wrapper for SpookyHash version 2, a fast non-cryptographic hash function. Current version 2.1.1 provides hash128 and hash64 algorithms with an API similar to hashlib. Release cadence is low; last update July 2024.

pip install spookyhash
INSTALL
IMPORT
SIG · SPOOKYHASH
S
spookyhash
databasepythonv2.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hash128
from spookyhash import hash128
hash128 is a function; no common wrong import.
hash64
from spookyhash import hash64
hash64 is a function; no common wrong import.
Hash
from spookyhash import Hash
Hash is the class for incremental hashing; no common wrong import.

Quickstart: compute hash of bytes or use incremental hashing.

from spookyhash import hash128, hash64 # Simple hashing print(hash128(b"hello world")) print(hash64(b"hello world")) # Incremental hashing (like hashlib) from spookyhash import Hash h = Hash() h.update(b"hello") h.update(b" world") print(h.hexdigest())
Debug
Known issues
breakingIn version 2.1.0, Hash.hexdigest() changed from returning bytes to returning str, aligning with hashlib. Code expecting bytes will break.
fix
Update code to expect str from hexdigest(), or use .digest() for bytes.
affects: >=2.1.0
gotchaspookyhash is non-cryptographic; do not use for security purposes like password hashing or digital signatures.
fix
Use hashlib or cryptography for secure hashing.
affects: all
deprecatedThe older spookyhash package (version 1.x) had a different API. Ensure you are using version 2.x and importing from 'spookyhash'.
fix
Upgrade to 2.1.1 and follow the current API.
affects: 1.x
Errors
Common errors & fixes
AttributeError: module 'spookyhash' has no attribute 'spookyhash128'
Old API from version 1.x imports incorrectly.
fix
Use from spookyhash import hash128 (or hash64).
TypeError: a bytes-like object is required, not 'str'
Passing a string instead of bytes to hash functions.
fix
Encode the string: hash128(b"text") or hash128("text".encode()).
Upgrade
Version history
2.1.1latest on PyPI · released Nov 9, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Meta
2
Resources
spookyhash — pip install spookyhash · libregistry