Skip to main content

b3c32 (Python)

Compact, hand-writable, prefix-matchable XOF hashes and identities for anything.

This is the Python implementation of b3c32, and until otherwise stated it is the reference implementation: the contract artifacts at the project root are certified against it, and other language implementations are certified against the same frozen vectors. That status is expected to change once a native Rust implementation exists.

Codes are unkeyed BLAKE3 sliced on 40-bit boundaries, encoded as low-pad bitstream Crockford Base32. The result is short enough to write by hand, unambiguous enough to read aloud, and prefix-matchable so a truncated code still resolves.

Use

from b3c32 import hash_b32

code = hash_b32(b"hello", 120)

Width is in bits. 120 is the current certified width. This is not a ceiling on usefulness: slice the returned code at any multiple of 40 bits, which is 5 bytes or 8 characters, and the short form is a true string prefix of the long one. Store the full code, index a prefix.

The package also exports hash_digest for raw digest bytes, the codec functions encode_crockford_b32, decode_crockford_b32, and coerce_crockford_b32, the alphabet as CROCKFORD32_ALPHABET, and the error types UncertifiedWidthError and CoercionError.

For input that should not be materialised, code_from_path, code_from_stream, and code_from_chunks take a path, a binary file object, or any iterable of byte chunks, with optional progress via on_progress (cumulative bytes) and interval_ms. Each has a digest_from_* counterpart returning raw digest bytes. The digest is the same however the input arrives.

Consuming

Pin an exact version. The project is pre-1.0 and no compatibility policy is in force, so any release may change the contract. Call verify_conformance in your own suite to learn when it does:

from b3c32 import verify_conformance

def test_b3c32_contract():
    verify_conformance()

It raises AssertionError naming the failed claim. Its scope is drift detection through the public API at the certified width; deep certification is this project's own suite against the pinned BLAKE3 reference vectors.

Status

Pre-release. Certification hardening is in progress. The full scheme definition, the normative conformance contract, and the frozen vectors live at the project root: https://github.com/marcus-grant/b3c32

Metadata

Release files for b3c32 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for b3c32 0.0.4
File Size Uploaded
b3c32-0.0.4.tar.gz 44.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for b3c32 0.0.4
File Interpreter ABI Platform
b3c32-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 61.1 kB

Release files / b3c32-0.0.4.tar.gz

Download URL b3c32-0.0.4.tar.gz
Size 44.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f3a33d72bde02e0e75eb44b7a35642938b4c5397e20f71b7129f0868d215d0a5
BLAKE2b-256 checksum
How to use checksums
89fb7cf011d220a87c9b616cad4e8161f0041ee4d5e811e04457ac322fce853c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / b3c32-0.0.4-py3-none-any.whl

Download URL b3c32-0.0.4-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b89d755216000b22b4c857224494cbb1533af613b20c65c7ae1b3a6958b0a15
BLAKE2b-256 checksum
How to use checksums
0915c16bd82f15fdc1e2a748cea924666bf5b96aca8267ccc07a33c26cd5fba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page