Blake2s constructor

Blake2s({
  1. int digestLength = 32,
  2. Uint8List? key,
  3. Uint8List? salt,
  4. Uint8List? personalization,
  5. Uint32List? iv,
})

The BLAKE2s (32-bit) flavor of the BLAKE2 cryptographic hash function.

digestLength must not be null and must be > 0.

key may be null, but if set, it will be used for the first round of compression.

salt, personalization, and iv may be null or must == 8 characters in length.

Implementation

Blake2s({
  this.digestLength = 32,
  this.key,
  this.salt,
  this.personalization,
  this.iv,
})  : assert(digestLength > 0 && digestLength <= 32),
      assert(salt == null || salt.length == 8),
      assert(personalization == null || personalization.length == 8),
      assert(iv == null || iv.length == 8) {
  iv ??= Uint32List.fromList(<int>[
    0x6A09E667,
   0xBB67AE85,
   0x3C6EF372,
   0xA54FF53A,
    0x510E527F,
   0x9B05688C,
   0x1F83D9AB,
   0x5BE0CD19,
  ]);

  reset();
}