mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
std.hash.crc: update legacy crc usage in std
This commit is contained in:
parent
ef5618fcd5
commit
5f0ecafa0d
@ -1150,7 +1150,7 @@ pub fn readElfDebugInfo(
|
||||
};
|
||||
|
||||
const mapped_mem = try mapWholeFile(elf_file);
|
||||
if (expected_crc) |crc| if (crc != std.hash.crc.Crc32SmallWithPoly(.IEEE).hash(mapped_mem)) return error.InvalidDebugInfo;
|
||||
if (expected_crc) |crc| if (crc != std.hash.crc.Crc32.hash(mapped_mem)) return error.InvalidDebugInfo;
|
||||
|
||||
const hdr: *const elf.Ehdr = @ptrCast(&mapped_mem[0]);
|
||||
if (!mem.eql(u8, hdr.e_ident[0..4], elf.MAGIC)) return error.InvalidElfMagic;
|
||||
|
@ -56,12 +56,8 @@ const hashes = [_]Hash{
|
||||
.name = "adler32",
|
||||
},
|
||||
Hash{
|
||||
.ty = hash.crc.Crc32WithPoly(.IEEE),
|
||||
.name = "crc32-slicing-by-8",
|
||||
},
|
||||
Hash{
|
||||
.ty = hash.crc.Crc32SmallWithPoly(.IEEE),
|
||||
.name = "crc32-half-byte-lookup",
|
||||
.ty = hash.crc.Crc32,
|
||||
.name = "crc32",
|
||||
},
|
||||
Hash{
|
||||
.ty = hash.CityHash32,
|
||||
|
Loading…
Reference in New Issue
Block a user