generateHashFile function
Method that generates a hash code from the contents of a file.
Implementation
Future<Digest> generateHashFile(
File file, [
Hash hashMethod = sha1,
]) async {
var output = AccumulatorSink<Digest>();
var input = hashMethod.startChunkedConversion(output);
await for (final val in file.openRead()) {
input.add(val);
}
input.close();
return output.events.single;
}