hashFile function

String hashFile(
  1. File file
)

Implementation

String hashFile(File file) {
  if (!file.existsSync()) {
    return "";
  }
  var digest = Digest("SHA-256");
  var hash = digest.process(utf8.encode(file.readAsStringSync()));
  return bin2hex(hash);
}