authorgravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2024-04-28 21:12:55+12:00
committergravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2024-04-28 21:12:55+12:00
log5f0ecafa0dddd9b630220d1c6cf4be2e42987faf
tree7937e6d4dcfa6e394d8771edc59af5da78fba8b6
parentef5618fcd5c0bf3389861c2071660b0a95428d13

std.hash.crc: update legacy crc usage in std


2 files changed, 3 insertions(+), 7 deletions(-)

lib/std/debug.zig+1-1
......@@ -1150,7 +1150,7 @@ pub fn readElfDebugInfo(
11501150 };
11511151
11521152 const mapped_mem = try mapWholeFile(elf_file);
1153 if (expected_crc) |crc| if (crc != std.hash.crc.Crc32SmallWithPoly(.IEEE).hash(mapped_mem)) return error.InvalidDebugInfo;
1153 if (expected_crc) |crc| if (crc != std.hash.crc.Crc32.hash(mapped_mem)) return error.InvalidDebugInfo;
11541154
11551155 const hdr: *const elf.Ehdr = @ptrCast(&mapped_mem[0]);
11561156 if (!mem.eql(u8, hdr.e_ident[0..4], elf.MAGIC)) return error.InvalidElfMagic;
lib/std/hash/benchmark.zig+2-6
......@@ -56,12 +56,8 @@ const hashes = [_]Hash{
5656 .name = "adler32",
5757 },
5858 Hash{
59 .ty = hash.crc.Crc32WithPoly(.IEEE),
60 .name = "crc32-slicing-by-8",
61 },
62 Hash{
63 .ty = hash.crc.Crc32SmallWithPoly(.IEEE),
64 .name = "crc32-half-byte-lookup",
59 .ty = hash.crc.Crc32,
60 .name = "crc32",
6561 },
6662 Hash{
6763 .ty = hash.CityHash32,