CryptFormat class
Provides encoding and decoding of PHC string format data.
PHC string format is a standardized way to represent password hashes generated by the competing password hashing algorithms. This format is designed to ensure consistency and interoperability between different password hashing implementations.
The string format specification:
$<id>[$v=<version>][$<param>=<value>(,<param>=<value>)*][$<salt>[$<hash>]]
This codec follows the PHC grammar above. It also parses the broader Modular
Crypt Format (e.g. bcrypt $2b$<cost>$<salt+hash>), but only by the PHC
field positions: such strings have no param=value segment, so a bcrypt
cost is read as the CryptData.salt and the combined salt+digest as the
CryptData.hash. The characters are preserved for round-tripping, but the
fields are not split into their MCF meanings.
Constructors
- CryptFormat()
-
Creates a new CryptFormat instance.
const
Properties
-
decoder
→ Converter<
String, CryptData> -
Returns the decoder of
this, converting fromTtoS.final -
encoder
→ Converter<
CryptData, String> -
Returns the encoder from
StoT.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
inverted
→ Codec<
String, CryptData> -
Inverts
this.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decode(
String encoded) → CryptData -
Decodes
encodeddata.inherited -
encode(
CryptData input) → String -
Encodes
input.inherited -
fuse<
R> (Codec< String, R> other) → Codec<CryptData, R> -
Fuses
thiswithother.inherited -
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