sha256Hash static method

Future<String> sha256Hash(
  1. File file
)

Computes the SHA-256 hash of a file's contents.

Implementation

static Future<String> sha256Hash(File file) async {
  final stream = file.openRead();
  final hash = await stream.transform(sha256).first;
  return hash.toString();
}