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 standard library. Private Function
writeHex
Private Function
std.http.BodyWriter.writeHex
fnwriteHex(buf: []u8, x: usize) void
Writes an integer as base 16 to buf, right-aligned, assuming the buffer has already been filled with zeroes.
Params
buf: []u8
x: usize
File
http.zig:1026
102610271028102910301031103210331034103510361037
fnwriteHex(buf: []u8, x: usize) void {
assert(std.mem.allEqual(u8, buf, '0'));
constbase = 16;
varindex: usize = buf.len;
vara = x;
while (a > 0) {
constdigit = a % base;
index -= 1;
buf[index] = std.fmt.digitToChar(@intCast(digit), .lower);
a /= base;
}
}
Writes an integer as base 16 to
buf, right-aligned, assuming the buffer has already been filled with zeroes.