PasswordHasher class
Provides secure password hashing using bcrypt. Each hash includes a unique salt, so the same password will produce different hashes. Use verify to check if a password matches a hash.
Constructors
- PasswordHasher()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
hash(
String password) → Result< String> -
Hashes a password using bcrypt with auto-generated salt.
Returns Result<String> with hash or error.
Note: The same password will produce different hashes each time due to unique salts.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verify(
String password, String hash) → Result< bool> - Verifies if a password matches a bcrypt hash. Returns Result<bool> - true if password matches, false otherwise.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited