skillfed

spookyhash

A Python wrapper for SpookyHash version 2

spookyhash v2.1.1 102.7K downloads/30d#12,852 on PyPI6
Permissive license MIT AGING released

What it is and what it does

spookyhash is a Python wrapper around Bob Jenkins' SpookyHash algorithm, a non-cryptographic hash function optimized for speed. It exposes three hash output sizes (32, 64, and 128 bits) and supports both one-shot hashing and incremental updates via stateful Hash objects. The library also handles memoryview-compatible types, making it convenient for NumPy arrays and other buffer-protocol objects.

The package targets use cases where you need fast, non-cryptographic hashing—such as hash tables, checksums, or data deduplication—rather than security-sensitive applications. It has no runtime dependencies and provides pre-built wheels for modern Python versions (3.7–3.14) across major platforms, though the project is aging with its last release 278 days ago.

Use it for:

  • Hash table or dictionary implementation where speed matters more than cryptographic security
  • Deduplication of large datasets by computing fast checksums on data chunks or NumPy arrays
  • Incremental hashing of streaming data or file chunks without loading entire content into memory
  • Fast content-based addressing in caching systems or distributed storage
  • Bloom filters or probabilistic data structures that require non-cryptographic hashing

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides fast 32-, 64-, and 128-bit hashing via Bob Jenkins' SpookyHash algorithm, with both one-shot and incremental hash modes and support for memoryview-compatible types like NumPy arrays.

Yes, if you need a fast non-cryptographic hash function for performance-critical applications like deduplication, caching, or hash tables. The MIT license is permissive, install friction is manageable with pre-built wheels, no vulnerabilities are known, and the API is straightforward. No if you require cryptographic security or active maintenance—the project is aging and has not been updated in 278 days.

Install

spookyhash on PyPI

pip

pip install spookyhash

uv

uv add spookyhash

poetry

poetry add spookyhash

Installing spookyhash

Before you install

Medium install friction due to compiled wheels; pre-built binaries available for Python 3.7–3.14 across macOS, Linux, Windows, and ARM platforms. Last release 278 days ago; repository active but aging.

License in practice

MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install spookyhash

import spookyhash

# One-shot hash
result = spookyhash.hash64(b'hello world')
print(result)  # 14865987102431973981

# Incremental hash
sh = spookyhash.Hash64()
sh.update(b'hello')
sh.update(b' world')
print(sh.hexdigest())  # 5d12ff9b81984ece

Verify before relying

  • Whether SpookyHash collisions are acceptable for your use case compared to cryptographic hashes
  • Performance benchmarks against Python's built-in hashlib for your typical data sizes

Package facts

License MIT (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 278 days since the last release
Last repo commit
First released
Downloads 102,745/month — #12,852 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: spookyhash-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl; spookyhash-2.1.1-cp310-cp310-macosx_11_0_arm64.whl; spookyhash-2.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spookyhash-2.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spookyhash-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl; spookyhash-2.1.1-cp310-cp310-musllinux_1_2_x86_64.whl; spookyhash-2.1.1-cp310-cp310-win32.whl; spookyhash-2.1.1-cp310-cp310-win_amd64.whl; spookyhash-2.1.1-cp310-cp310-win_arm64.whl; spookyhash-2.1.1-cp311-cp311-macosx_10_9_x86_64.whl; spookyhash-2.1.1-cp311-cp311-macosx_11_0_arm64.whl; spookyhash-2.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spookyhash-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spookyhash-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl; spookyhash-2.1.1-cp311-cp311-musllinux_1_2_x86_64.whl; spookyhash-2.1.1-cp311-cp311-win32.whl; spookyhash-2.1.1-cp311-cp311-win_amd64.whl; spookyhash-2.1.1-cp311-cp311-win_arm64.whl; spookyhash-2.1.1-cp312-cp312-macosx_10_13_x86_64.whl; spookyhash-2.1.1-cp312-cp312-macosx_11_0_arm64.whl

Keywords: SpookyHash, hashlib

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTyping :: Typed

Tags

spookyhash algorithm pythonfast hash function 32 64 128 bitbob jenkins spooky hashincremental hashing pythonmemoryview compatible hashnumpy array hashingnon-cryptographic hash library
hashingnon-cryptographicperformance

More Libraries packages