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.
Ripemd160Hasher and WhirlpoolHasher are legacy digest hashers that rely on the pycryptodome library. Ripemd160Hasher is suitable for verifying RIPEMD-160 hashes from older systems, while WhirlpoolHasher is fully deprecated — its implementation uses SHA-512 internally rather than the Whirlpool algorithm, and it blocks the creation of new hashes unless explicitly opted in. Both hashers are provided to support migration scenarios and should not be used for new hash generation.
Installation
Both hashers require thepycryptodome package:
Ripemd160Hasher
A hasher backed by pycryptodome’s Crypto.Hash.RIPEMD160. Accepts both the canonical ripemd160 prefix and the legacy RIPEMD-160 prefix produced by older tools.
Import
Constructor
Crypto.Hash.RIPEMD160 on instantiation.
Hash format
Methods
hash(string: str) -> str
Computes the RIPEMD-160 digest of string and returns it in ripemd160$<hex> format.
verify(string: str, hashed_string: str) -> bool
Parses the algorithm prefix and hex digest from hashed_string, re-computes the RIPEMD-160 digest of string, and compares using hmac.compare_digest. Accepts both ripemd160$ and RIPEMD-160$ prefixes.
needs_rehash(hashed_string: str) -> bool
Returns True when the prefix in hashed_string is the legacy RIPEMD-160 token rather than the canonical ripemd160 token. This allows applications to normalise old hashes to the canonical format during a migration.
can_handle(hashed_string: str) -> bool
Returns True if hashed_string starts with either ripemd160$ or RIPEMD-160$.
WhirlpoolHasher
Import
Constructor
When
True (the default), the verify method will attempt to verify existing whirlpool$ hashes. Set to False only if you want to completely disable verification.When
False (the default), calling hash() raises InvalidHasherError. Set to True only if you explicitly need to produce new SHA-512-backed whirlpool$ hashes for backward-compatibility purposes.allow_legacy_verify=False and allow_legacy_hashing=False are passed simultaneously, the constructor itself raises InvalidHasherError because there is no valid use for a WhirlpoolHasher that can neither hash nor verify.
A DeprecationWarning is always emitted at instantiation time, regardless of the flags.
Hash format
Methods
hash(string: str) -> str
Raises InvalidHasherError unless allow_legacy_hashing=True. When permitted, computes a SHA-512 digest of string and returns it in whirlpool$<hex> format.
verify(string: str, hashed_string: str) -> bool
Returns False immediately when allow_legacy_verify=False. Otherwise parses the prefix and hex digest from hashed_string, re-computes the SHA-512 digest, and compares using hmac.compare_digest.
needs_rehash(hashed_string: str) -> bool
Returns True when the algorithm prefix in hashed_string does not match whirlpool.
