diff --git a/src/lib.zig b/src/lib.zig index ed633a9548649c6fbf09b4418375cab670bd03c7..60046b2b86852257db43bdd1550535156f9f2633 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -377,6 +377,7 @@ pub fn hashBytes(comptime Algo: type, bytes: []const u8) [Algo.digest_length]u8 } pub fn readType(reader: anytype, comptime T: type, endian: std.builtin.Endian) !T { + if (T == u8) return reader.readByte(); // single bytes dont have an endianness return switch (@typeInfo(T)) { .Struct => |t| { switch (t.layout) {