encodeArgon2Phc function

String encodeArgon2Phc(
  1. Uint8List hash,
  2. Uint8List salt,
  3. Argon2Options options
)

Encodes hash and salt in the PHC string format.

Implementation

String encodeArgon2Phc(Uint8List hash, Uint8List salt, Argon2Options options) {
  final saltB64 = _b64NoPad(salt);
  final hashB64 = _b64NoPad(hash);
  return '\$${options.type.phcName}\$v=19'
      '\$m=${options.memoryKib},t=${options.iterations},p=${options.lanes}'
      '\$$saltB64\$$hashB64';
}