pub fn printHex(w: *Writer, bytes: []const u8, case: std.fmt.Case) Error!void
w: *Writer
bytes: []const u8
case: std.fmt.Case
WriteFailed
See the Writer implementation for detailed diagnostics.
Writer
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946
pub fn printHex(w: *Writer, bytes: []const u8, case: std.fmt.Case) Error!void { const charset = switch (case) { .upper => "0123456789ABCDEF", .lower => "0123456789abcdef", }; for (bytes) |c| { try w.writeByte(charset[c >> 4]); try w.writeByte(charset[c & 15]); } }