Expand description
BLAKE3 hashing helpers.
A Hash is a fixed 32-byte digest. The canonical hex form is 64
lowercase characters. Object-store paths split the digest into a
first-byte directory and 62-char file-name (see SPEC-OBJECTS.md
§10).
Structs§
- Hasher
- Incremental BLAKE3 hasher for streaming data.
- Object
Path - Object-store path split:
<first-byte-hex>/<remaining-62-hex>.
Enums§
- From
HexError - Errors returned by
from_hex.
Constants§
- HASH_
LEN - Length, in bytes, of a BLAKE3 digest used throughout mkit.
- HEX_LEN
- Length of the lowercase-hex encoding of a
Hash. - ZERO
- The all-zero digest. Used as the “absent” sentinel for optional
annotation fields on commit objects (
message_hash,content_digest).
Functions§
- domain_
digest - Domain-separated BLAKE3 digest.
- from_
hex - Parse a lowercase-or-uppercase 64-char hex string into a
Hash. Rejects any non-hex byte. - hash
- Hash arbitrary bytes in one shot.
- object_
path - Split a
Hashinto its object-store path components. - to_hex
- Render a
Hashas lowercase hex. - to_
hex_ bytes - Render a byte slice as lowercase hex.
format!-with-{:02x}allocates per byte; the hand-roll here is the workspace’s canonical hex encoder. Use this everywhere a byte slice needs hex rendering.
Type Aliases§
- Hash
- Fixed-size BLAKE3 digest.
Copybecause it is tiny and cheap.