Hash Forge uses a small, focused exception hierarchy rooted atDocumentation 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.
HashForgeError. All library-specific errors are subclasses of this base, making it easy to write broad except HashForgeError clauses when you want to handle any Hash Forge error generically, or to catch individual subclasses when you need fine-grained control. All exceptions are defined in hash_forge.exceptions and re-exported from the top-level hash_forge package.
Import
Exception hierarchy
HashForgeError
Base exception for all Hash Forge errors. Inherits directly from Python’s built-in Exception.
Catch HashForgeError when you want a single handler that covers every error the library can raise — for example in a top-level error handler or when wrapping Hash Forge calls in a service boundary.
InvalidHasherError
Raised when hasher configuration is invalid.
This exception is raised at construction time when the caller passes parameters that violate enforced security minimums (e.g., too few PBKDF2 iterations, bcrypt rounds below 12, scrypt work_factor not a power of two). It is also raised by HashManager when it is instantiated with an empty list of hashers, and by WhirlpoolHasher.hash() when allow_legacy_hashing is False.
InvalidHashFormatError
Raised when a hash string has an invalid or unrecognised format.
This exception signals that a string passed to a hashing operation (such as verify or needs_rehash) does not conform to the expected algorithm$... structure, or that the fields within the hash are malformed. Callers should treat this as a data integrity issue rather than a credentials mismatch.
UnsupportedAlgorithmError
Raised by HasherFactory.create when the requested algorithm is not registered.
When you ask the factory to create a hasher for an algorithm name that has not been registered, UnsupportedAlgorithmError is raised. This can occur if a typo is made in the algorithm name, or if an optional hasher (e.g., argon2) has not been installed and registered.
HasherNotFoundError
Raised when no registered hasher can handle a given hash string.
When HashManager (or similar dispatch logic) iterates over all registered hashers and none of them returns True from can_handle() for a given hash string, HasherNotFoundError is raised. This typically means the hash was produced by an algorithm that is not included in the current HashManager configuration.
