skillfed

py-multihash

Multihash implementation in Python

py-multihash v3.0.0 162.4K downloads/30d#10,606 on PyPI945
Permissive license MIT AGING released

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-multihash

uv

uv add py-multihash

poetry

poetry add py-multihash

Installing 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

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

multihash encoding decodinghash function wrapperblake3 sha256 hashingcryptographic hash librarymultihash digest pythonhash serialization formatstreaming hash computation
multihashcontent-addressinghash-serialization

More Cryptography packages