verifyHash method

Future<bool> verifyHash(
  1. String filePath,
  2. String expectedHash
)

Verifies a file's integrity against an expected SHA-256 hash.

Returns true if the file matches, false otherwise.

Implementation

Future<bool> verifyHash(String filePath, String expectedHash) async {
  final actualHash = await computeHash(filePath);
  return actualHash == expectedHash;
}