Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Zozi96/hash-forge/llms.txt
Use this file to discover all available pages before exploring further.
Blake2Hasher and Blake3Hasher provide fast cryptographic hash digests using the BLAKE2b and BLAKE3 algorithms respectively. Both are designed for data integrity, checksums, and general-purpose cryptographic hashing — not for password storage. They produce deterministic output for a given input and have no built-in work factor, making them unsuitable as password hashers.
Blake2Hasher
A hasher backed by Python’s stdlib hashlib.blake2b. No additional dependencies are required.
Import
Constructor
An optional key for BLAKE2b’s keyed-hashing mode. When provided, the hash is an HMAC-like keyed digest. Pass an empty string (the default) for plain, un-keyed hashing.
Size of the BLAKE2b digest in bytes. Valid range is 1–64. The value is embedded in the hash string and checked during verification and rehash detection.
Hash format
Methods
hash(string: str) -> str
Computes the BLAKE2b digest of string and returns it in the canonical blake2$<digest_size>$<hex> format.
verify(string: str, hashed_string: str) -> bool
Re-computes the BLAKE2b digest using the digest_size stored in hashed_string and compares with hmac.compare_digest. Accepts both blake2$ and blake2b$ prefixes for backward compatibility.
needs_rehash(hashed_string: str) -> bool
Returns True when the digest_size embedded in hashed_string differs from the current digest_size, or when the prefix is the legacy blake2b token instead of the canonical blake2 token.
can_handle(hashed_string: str) -> bool
Returns True if hashed_string starts with either blake2$ or blake2b$, allowing the hasher to accept hashes produced under either prefix.
Blake3Hasher
A hasher backed by the blake3 Python package. BLAKE3 is a modern cryptographic hash function that is faster than BLAKE2 on modern hardware and parallelises across CPU cores.
Installation
Import
Constructor
Blake3Hasher has no configurable parameters. The output size is fixed by the blake3 library’s defaults.
Hash format
Methods
hash(string: str) -> str
Computes the BLAKE3 digest of string and returns it in blake3$<hex> format.
verify(string: str, hashed_string: str) -> bool
Re-computes the BLAKE3 digest and compares using hmac.compare_digest. Returns False if the prefix does not match blake3.
needs_rehash(hashed_string: str) -> bool
Returns True only if the algorithm prefix in hashed_string is not blake3. BLAKE3 has no tunable cost parameters, so the only reason to rehash is an algorithm mismatch.
