fn hexToBytes(comptime hex: []const u8, out: []u8) !void
fn hexToBytes(comptime hex: []const u8, out: []u8) !void { if (hex.len != out.len * 2) return error.InvalidLength; var i: usize = 0; while (i < out.len) : (i += 1) { const hi = try std.fmt.charToDigit(hex[i * 2], 16); const lo = try std.fmt.charToDigit(hex[i * 2 + 1], 16); out[i] = (hi << 4) | lo; } }