hash static method
Computes the MD5 hash of the provided data
and returns the 128-bit (16-byte)
MD5 message digest as a List<int>.
This static method is a convenient way to compute an MD5 hash for a given data without creating an instance of the MD5 class.
Example usage:
final data = List<int>.from('Hello, MD5!'.codeUnits);
final digest = MD5.hash(data);
Note: It is recommended to clean up resources using the clean
method after
using the MD5 hash instance.
Implementation
static List<int> hash(List<int> data) {
final h = MD5();
h.update(data);
final digest = h.digest();
h.clean();
return digest;
}