Skip to main content

Multihash implementation in Python

Project description

https://img.shields.io/pypi/v/py-multihash.svg https://github.com/multiformats/py-multihash/actions/workflows/tox.yml/badge.svg Documentation Status

Multihash implementation in Python

Features

  • Support for 125+ hash functions including:

    • Cryptographic hashes: SHA-1, SHA-2 (224/256/384/512), SHA-3, BLAKE2b, BLAKE2s, BLAKE3

    • Variable-length hashes: SHAKE-128, SHAKE-256

    • Non-cryptographic hashes: MurmurHash3 (32-bit and 128-bit)

    • Specialized hashes: Double-SHA-256 (Bitcoin), Keccak, and more

    • BLAKE2 variants: Full range of digest sizes (8-512 bits for BLAKE2b, 8-256 bits for BLAKE2s)

  • Streaming hash computation for large files

  • Hash truncation support

  • JSON serialization

  • MultihashSet collection type

  • Go-compatible API (sum(), digest(), verify())

Quick Start

from multihash import digest, sum, Func

# Using modern hash functions
mh = digest(b"hello world", "blake3")

# Using MurmurHash3 for fast, non-cryptographic hashing
mh = digest(b"data", "murmur3-128")

# Using BLAKE2b with custom digest size
mh = digest(b"data", "blake2b-256")

# Go-compatible API
mh = sum(b"hello world", Func.sha2_256)
print(mh.encode('hex'))

For more examples and usage, see the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_multihash-3.0.0.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_multihash-3.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file py_multihash-3.0.0.tar.gz.

File metadata

  • Download URL: py_multihash-3.0.0.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for py_multihash-3.0.0.tar.gz
Algorithm Hash digest
SHA256 2e848941de5ef0533ca26b81940e2ffcf7b4322a3f803e8c97f4f0eca8767aa7
MD5 bcb0d353215cb29b60daa542b7998bbb
BLAKE2b-256 113ded68b0eccd0654f7f3c163d9b3d428f903e5e3e884ab1f0d0a16ba6a4f11

See more details on using hashes here.

File details

Details for the file py_multihash-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_multihash-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for py_multihash-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3863ec1313b4eac1e5169137c143d40bf77456e57388f839441deba089f87326
MD5 b2d22b8b4bb5a39ecf1469d0cefe1d95
BLAKE2b-256 24e2d65606db8369916fb5a9b4fe14df7e6072970d919300f3fb1c989a1d8e7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page