PasswordEncoder class abstract

Service interface for encoding passwords.

The preferred implementation is BCryptPasswordEncoder.

Implementers

Constructors

PasswordEncoder()

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

encode(String rawPassword) String
Encode the raw password. Generally, a good encoding algorithm applies a SHA-1 or greater hash combined with an 8-byte or greater randomly generated salt.
matches(String rawPassword, String encodedPassword) bool
Verify the encoded password obtained from storage matches the submitted raw password after it too is encoded. Returns true if the passwords match, false if they do not. The stored password itself is never decoded. @param rawPassword the raw password to encode and match @param encodedPassword the encoded password from storage to compare with @return true if the raw password, after encoding, matches the encoded password from storage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
upgradeEncoding(String encodedPassword) bool
Returns true if the encoded password should be encoded again for better digest, else false. The default implementation always returns false. @param encodedPassword the encoded password to check @return true if the encoded password should be encoded again for better digest, else false.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isEqual(Int8List digesta, Int8List digestb) bool
Compares two digests for equality. Two digests are equal if they have the same length and all bytes at corresponding positions are equal.