Digest.from constructor
Gets a validated digest from an array of bytes
Parameter bytes
: the bytes to be converted into a digest
Returns a validated digest with a possible invalid digest error
Implementation
factory Digest.from(Uint8List bytes, int size) {
if (bytes.length != size) {
throw IncorrectSize('Digest is not $size bytes long');
}
return Digest(size, bytes);
}