consumeAs method

Future<HashDigest> consumeAs(
  1. Stream<String> stream, [
  2. Encoding encoding = latin1
])

Consumes the entire stream of string and generates a HashDigest.

Default encoding scheme to get the input bytes is latin1.

Implementation

@pragma('vm:prefer-inline')
Future<HashDigest> consumeAs(
  Stream<String> stream, [
  Encoding encoding = latin1,
]) {
  return bind(stream.transform(encoding.encoder)).first;
}