fileSha256 function

Future<String?> fileSha256(
  1. String path
)

SHA-256 of a file (hex), or null when the file does not exist.

Implementation

Future<String?> fileSha256(String path) async {
  final f = File(path);
  if (!f.existsSync()) return null;
  return sha256.convert(await f.readAsBytes()).toString();
}