Skip to documentation
SLOP

tiny.cook.digestFile

Reference tiny.cook digestFile

Defined in tiny.cook.

Called byCallsNo direct callsKeyfromCodeFileprivate sourcelib.cook.src.cache.Storewalktiny.cookdigestFile
Static calls · unresolved targets: 3 · external targets: 2.

Source

Source: lib/cook/src/cache.zig:58

zig
pub fn digestFile(io: std.Io, file: std.Io.File) ![32]u8 {    const stat = try file.stat(io);    var hasher = Sha256.init(.{});    var buffer: [64 * 1024]u8 = undefined;    var offset: u64 = 0;    while (offset < stat.size) {        const wanted: usize = @intCast(@min(stat.size - offset, buffer.len));        const count = try file.readPositionalAll(io, buffer[0..wanted], offset);        if (count != wanted) return error.ShortRead;        hasher.update(buffer[0..count]);        offset += count;    }    var digest: [32]u8 = undefined;    hasher.final(&digest);    return digest;}

Source: lib/cook/src/root.zig:9

zig
pub const digestFile = cache.digestFile;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433