fn hashFile(io: Io, file: Io.File, bin_digest: *[Hasher.mac_length]u8) Io.File.ReadPositionalError!void 1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320fn hashFile(io: Io, file: Io.File, bin_digest: *[Hasher.mac_length]u8) Io.File.ReadPositionalError!void {
var buffer: [2048]u8 = undefined;
var hasher = hasher_init;
var offset: u64 = 0;
while (true) {
const n = try file.readPositional(io, &.{&buffer}, offset);
if (n == 0) break;
hasher.update(buffer[0..n]);
offset += n;
}
hasher.final(bin_digest);
}