computeHash method

Future<String> computeHash(
  1. String filePath
)

Computes the SHA-256 hash of a file at filePath.

Used for integrity verification: the sender computes the hash when creating the message, and the receiver verifies after the FILE transfer completes.

Implementation

Future<String> computeHash(String filePath) async {
  final file = File(filePath);
  final bytes = await file.readAsBytes();
  return _computeHashFromBytes(bytes);
}