hash static method
Computes the BLAKE2b hash of the given input data.
This method creates a BLAKE2b instance with optional configuration, updates it with the input data, and then computes the hash digest. After hashing, the instance is cleaned to remove sensitive data.
Parameters:
data
: The input data to be hashed.digestLength
: The length of the hash digest in bytes (default is 64 bytes).config
: Optional configuration for BLAKE2b (e.g., key, salt, personalization).
Returns: A List
Implementation
static List<int> hash(List<int> data,
[int digestLength = 64, Blake2bConfig? config]) {
final h = BLAKE2b(digestLength: digestLength, config: config);
h.update(data);
final digest = h.digest();
h.clean();
return digest;
}