Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

calcSize

Compute the number of bytes required to serialize params

phc_encoding.calcSize
pub fn calcSize(params: anytype) usize

File

lib/std/crypto/phc_encoding.zig:199

Code

pub fn calcSize(params: anytype) usize {
    var trash: [128]u8 = undefined;
    var d: Writer.Discarding = .init(&trash);
    serializeTo(params, &d.writer) catch unreachable;
    return @intCast(d.fullCount());
}