blake2b static method

Uint8List blake2b(
  1. dynamic message, {
  2. int? digestSize,
  3. Uint8List? key,
  4. Uint8List? salt,
  5. Uint8List? personalisation,
})

Returns a Blake2b hash of the message.

Implementation

static Uint8List blake2b(dynamic message,
    {int? digestSize,
    Uint8List? key,
    Uint8List? salt,
    Uint8List? personalisation}) {
  if (message is String) {
    message = Uint8List.fromList(utf8.encode(message));
  } else if (message is! Uint8List) {
    throw Exception('The message must be either of string or Uint8List');
  }

  return Blake2b.digest(message as Uint8List,
      digestSize: digestSize ?? defaultHashLength,
      key: key,
      salt: salt,
      personal: personalisation);
}