Hash.fromBytes constructor

Hash.fromBytes(
  1. Uint8List bytes
)

Create hash from byte array with validation

Implementation

factory Hash.fromBytes(Uint8List bytes) {
  if (bytes.length != hashSize) {
    throw ArgumentError('Invalid hash length: ${bytes.length}, expected: $hashSize');
  }
  return Hash._(Uint8List.fromList(bytes));
}