py-multihash
Multihash implementation in Python
What it is and what it does
py-multihash is a Python implementation of the multihash specification, a self-describing hash digest format that encodes both the hash function used and the digest itself. It wraps support for 125+ hash functions—including cryptographic algorithms (SHA-1, SHA-2, SHA-3, BLAKE2, BLAKE3), variable-length hashes (SHAKE-128/256), and non-cryptographic options (MurmurHash3)—behind a unified interface. The package provides streaming computation for large files, hash truncation, JSON serialization, and a Go-compatible API (sum, digest, verify methods).
Typical use cases include content-addressed storage systems, distributed systems that need portable hash identification, and applications requiring interoperability with Go-based multihash implementations. The package depends on six runtime libraries: varint, six, morphys, base58, blake3, and mmh3. It is maintained as a Pre-Alpha project but has been in development since 2018 and remains actively used.
Use it for:
- Content-addressed storage or IPFS-like systems where hash function identity must be encoded alongside the digest.
- Distributed systems needing portable, self-describing hash formats for cross-language compatibility.
- Applications requiring fast non-cryptographic hashing via MurmurHash3 or cryptographic hashing via BLAKE3.
- Systems that need to serialize and deserialize hashes in JSON or hex format with function metadata preserved.
- Streaming hash computation over large files without loading entire contents into memory.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes multihash digests, supporting 125+ hash functions including SHA-2, SHA-3, BLAKE2, BLAKE3, and MurmurHash3, with streaming computation and JSON serialization.
Yes, with conditions. The package is permissively licensed, has low install friction, and supports current Python versions. However, its Pre-Alpha status and aging maintenance (240 days since last release, last commit 2026-01-05) mean it is not actively developed. Install if you need multihash interoperability or Go-compatible hash APIs; avoid if you require active maintenance or stability guarantees.
Install
py-multihash on PyPI
pip
pip install py-multihashuv
uv add py-multihashpoetry
poetry add py-multihashInstalling py-multihash
Before you install
Low install friction with six runtime dependencies delivered as a pure-Python wheel. Maintenance status is aging—last commit was 2026-01-05 and the latest release 240 days old—but the repository remains active and unarchived with 945 stars.
License in practice
MIT license is permissive and poses no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
pip install py-multihash
from multihash import digest, sum, Func
mh = digest(b"hello world", "blake3")
mh = sum(b"hello world", Func.sha2_256)
print(mh.encode('hex'))
Requires Python 3.10 or later (supports up to 3.14).
Verify before relying
- Whether the 125+ hash functions claim includes all variants (e.g., BLAKE2b digest sizes 8-512 bits) or counts them separately.
- Performance characteristics of streaming hash computation for large files relative to standard library hashlib.
- Compatibility guarantees with the Go multihash reference implementation beyond the API surface.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — varint, six, morphys, base58, blake3, mmh3 |
| Maintenance | aging — 240 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 162,401/month — #10,606 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_multihash-3.0.0-py3-none-any.whl
Keywords: multihash
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
blake3Python bindings for the BLAKE3 cryptographic…
permissive · top 5,000 on PyPI
mmhash3mmhash3 is a Python wrapper for MurmurHash3,…
permissive · top 15,000 on PyPI
filehashCalculates and verifies file checksums and…
permissive · top 15,000 on PyPI
xxhashxxhash provides fast non-cryptographic hashing…
permissive · top 1,000 on PyPI
bbhashBuilds minimal perfect hash functions for…
unclear · top 15,000 on PyPI
murmurhashProvides fast MurmurHash2 hashing through…
permissive · top 1,000 on PyPI
pysha3Provides SHA-3, SHAKE, and Keccak hash…
permissive · top 15,000 on PyPI
mmh3mmh3 is a Python binding to MurmurHash3, a fast…
permissive · top 1,000 on PyPI
murmurhash2Provides 32-bit murmurhash2 and murmurhash3…
permissive · top 5,000 on PyPI
safe-pysha3Provides SHA-3, SHAKE, and Keccak hash…
permissive · top 15,000 on PyPI