siphash24
Streaming-capable SipHash-1-3 and SipHash-2-4 Implementation
What it is and what it does
siphash24 is a Python wrapper around a C implementation of the SipHash cryptographic hash function, offering both SipHash-1-3 and SipHash-2-4 variants. It exposes an interface compatible with Python's standard hashlib module, so you can use it like any other hash function—calling update() to feed data and digest() to retrieve the result. The package extends hashlib's interface with an intdigest() method that returns the hash as a 64-bit signed integer instead of bytes, which is the conventional representation for SipHash values.
The implementation is streaming-capable, meaning you can hash large amounts of data incrementally rather than loading it all into memory at once. It ships as precompiled binary wheels for Python 3.7–3.14 on macOS, Linux, and Windows, eliminating the need to compile C code on most systems. The underlying C code is based on the c-siphash library and ultimately derives from the SipHash reference implementation, so it is well-established and widely reviewed.
Use it for:
- Hash table implementations or data structures that require a fast, non-cryptographic hash function resistant to hash collision attacks.
- Incremental hashing of large files or network streams where you cannot load the entire input into memory at once.
- Cryptographic applications that specifically require SipHash-2-4 or SipHash-1-3 variants for compatibility or security requirements.
- Scenarios where you need both byte and integer representations of hash values without manual conversion.
- Projects that want a hashlib-compatible API but need the specific properties of SipHash rather than MD5 or SHA.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a C-based SipHash-1-3 and SipHash-2-4 implementation with a hashlib-compatible interface and streaming support, returning digests as bytes or 64-bit signed integers.
Yes, if you specifically need SipHash and want a hashlib-compatible interface with streaming support. The package is stable, well-maintained enough for production use, has no known vulnerabilities, and provides convenient precompiled wheels. However, the aging maintenance status (346 days since last release) and unclear license metadata warrant a quick review of your licensing requirements before committing. If you only need a general-purpose hash function, Python's built-in hashlib is a simpler choice.
Install
siphash24 on PyPI
pip
pip install siphash24uv
uv add siphash24poetry
poetry add siphash24Installing siphash24
Before you install
Medium install friction due to compiled wheels; however, prebuilt binaries are available for Python 3.7–3.14 across macOS (x86_64 and arm64), Linux (x86_64 and aarch64), and Windows (32-bit and 64-bit), reducing build complexity. Maintenance status is aging—last release was 346 days ago—but the repository remains active and the package is marked Production/Stable.
License in practice
Licensed under Apache-2.0 OR LGPL-2.1-or-later with unclear treatment in the package metadata. The dual licensing permits use in both permissive and copyleft contexts, but you should verify which license applies to your use case and confirm compliance with your project's license policy.
Quickstart
import siphash24
# Create a SipHash-2-4 hasher
hasher = siphash24.SipHash_2_4()
hasher.update(b'hello world')
# Get digest as bytes
digest = hasher.digest()
print(digest)
# Or get as 64-bit signed integer
int_digest = hasher.intdigest()
print(int_digest)
Requires Python 3.7 or later. Precompiled wheels are provided for common platforms; source builds require a C compiler and Cython.
Verify before relying
- Whether the dual Apache-2.0 OR LGPL-2.1-or-later license is correctly declared in package metadata (license_treatment is marked 'unclear').
- Performance characteristics compared to hashlib's built-in hash functions or other SipHash implementations.
- Whether streaming mode is suitable for your use case or if a single-pass hash is sufficient.
Package facts
| License | Apache-2.0 OR LGPL-2.1-or-later (unclear) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 346 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 510,712/month — #6,265 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: siphash24-1.8-cp310-cp310-macosx_10_9_x86_64.whl; siphash24-1.8-cp310-cp310-macosx_11_0_arm64.whl; siphash24-1.8-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; siphash24-1.8-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; siphash24-1.8-cp310-cp310-win32.whl; siphash24-1.8-cp310-cp310-win_amd64.whl; siphash24-1.8-cp311-cp311-macosx_10_9_x86_64.whl; siphash24-1.8-cp311-cp311-macosx_11_0_arm64.whl; siphash24-1.8-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; siphash24-1.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; siphash24-1.8-cp311-cp311-win32.whl; siphash24-1.8-cp311-cp311-win_amd64.whl; siphash24-1.8-cp312-cp312-macosx_10_13_x86_64.whl; siphash24-1.8-cp312-cp312-macosx_11_0_arm64.whl; siphash24-1.8-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; siphash24-1.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; siphash24-1.8-cp312-cp312-win32.whl; siphash24-1.8-cp312-cp312-win_amd64.whl; siphash24-1.8-cp313-cp313-macosx_10_13_x86_64.whl; siphash24-1.8-cp313-cp313-macosx_11_0_arm64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
siphashProvides a Python implementation of SipHash, a…
permissive · top 15,000 on PyPI
siphashcsiphashc provides a Python binding to the…
permissive · top 15,000 on PyPI
xxhashxxhash provides fast non-cryptographic hashing…
permissive · top 1,000 on PyPI
poseidon-pyPoseidon hash implementation in Python with a…
unclear · top 15,000 on PyPI
mmhash3mmhash3 is a Python wrapper for MurmurHash3,…
permissive · top 15,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI
bbhashBuilds minimal perfect hash functions for…
unclear · top 15,000 on PyPI
pysha3Provides SHA-3, SHAKE, and Keccak hash…
permissive · top 15,000 on PyPI
safe-pysha3Provides SHA-3, SHAKE, and Keccak hash…
permissive · top 15,000 on PyPI
murmurhashProvides fast MurmurHash2 hashing through…
permissive · top 1,000 on PyPI