HashManager class final
Creates and verifies password hashes off the event loop.
Both make and check run in a compute isolate (Isolate.run) so a 100 ms Argon2id derivation never stalls other requests on the HTTP isolate (ADR-004/ADR-008).
Constructors
- HashManager(HashConfig config)
Properties
- config → HashConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
String plain, String hashed) → Future< bool> -
Verifies
plainagainsthashed; the driver is detected from the hash prefix. Unknown or malformed hashes never match. -
checkAgainstDummy(
String plain) → Future< void> -
Spends the same time as a real check of
plain, for when no user matched the credentials, so response timing does not reveal which accounts exist (BLUEPRINT_V2 §9.2 item 9). Always completes normally. -
info(
String hashed) → HashInfo -
Parses the driver and cost parameters out of
hashed. -
isHashed(
String hashed) → bool -
Whether
hashedlooks like a hash produced by any known driver. -
make(
String plain, {HashDriver? driver}) → Future< String> -
Hashes
plainwith the configured driver (ordriver). -
needsRehash(
String hashed) → bool -
Whether
hashedwas produced by a different driver or cost than the current configuration (call after a successful login to upgrade). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited