toEncoded method
Gets a PHC-compliant encoded string
Implementation
String toEncoded([Uint8List? hashBytes]) {
var hash = toBase64(salt, codec: Base64Codec.bcrypt);
if (hashBytes != null) {
hash += toBase64(hashBytes, codec: Base64Codec.bcrypt);
}
return toCrypt(
CryptDataBuilder(version.name)
.salt('$cost'.padLeft(2, '0'))
.hash(hash)
.build(),
);
}