| ... | ... | @@ -15,7 +15,7 @@ const Arch = std.Target.Cpu.Arch; |
| 15 | 15 | const Abi = std.Target.Abi; |
| 16 | 16 | const OsTag = std.Target.Os.Tag; |
| 17 | 17 | const assert = std.debug.assert; |
| 18 | | const Sha256 = std.crypto.hash.sha2.Sha256; |
| 18 | const Blake3 = std.crypto.hash.Blake3; |
| 19 | 19 | |
| 20 | 20 | const LibCTarget = struct { |
| 21 | 21 | name: []const u8, |
| ... | ... | @@ -314,7 +314,7 @@ pub fn main() !void { |
| 314 | 314 | var max_bytes_saved: usize = 0; |
| 315 | 315 | var total_bytes: usize = 0; |
| 316 | 316 | |
| 317 | | var hasher = Sha256.init(.{}); |
| 317 | var hasher = Blake3.init(.{}); |
| 318 | 318 | |
| 319 | 319 | for (libc_targets) |libc_target| { |
| 320 | 320 | const dest_target = DestTarget{ |
| ... | ... | @@ -360,7 +360,7 @@ pub fn main() !void { |
| 360 | 360 | const trimmed = std.mem.trim(u8, raw_bytes, " \r\n\t"); |
| 361 | 361 | total_bytes += raw_bytes.len; |
| 362 | 362 | const hash = try allocator.alloc(u8, 32); |
| 363 | | hasher = Sha256.init(.{}); |
| 363 | hasher = Blake3.init(.{}); |
| 364 | 364 | hasher.update(rel_path); |
| 365 | 365 | hasher.update(trimmed); |
| 366 | 366 | hasher.final(hash); |
| ... | ... | @@ -412,12 +412,12 @@ pub fn main() !void { |
| 412 | 412 | { |
| 413 | 413 | var hash_it = path_kv.value.iterator(); |
| 414 | 414 | while (hash_it.next()) |hash_kv| { |
| 415 | | const contents = &hash_to_contents.get(hash_kv.value).?; |
| 415 | const contents = &hash_to_contents.getEntry(hash_kv.value).?.value; |
| 416 | 416 | try contents_list.append(contents); |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | std.sort.sort(*Contents, contents_list.span(), {}, Contents.hitCountLessThan); |
| 420 | | var best_contents = contents_list.popOrNull().?; |
| 420 | const best_contents = contents_list.popOrNull().?; |
| 421 | 421 | if (best_contents.hit_count > 1) { |
| 422 | 422 | // worth it to make it generic |
| 423 | 423 | const full_path = try std.fs.path.join(allocator, &[_][]const u8{ out_dir, generic_name, path_kv.key }); |
| ... | ... | @@ -434,7 +434,7 @@ pub fn main() !void { |
| 434 | 434 | } |
| 435 | 435 | var hash_it = path_kv.value.iterator(); |
| 436 | 436 | while (hash_it.next()) |hash_kv| { |
| 437 | | const contents = &hash_to_contents.get(hash_kv.value).?; |
| 437 | const contents = &hash_to_contents.getEntry(hash_kv.value).?.value; |
| 438 | 438 | if (contents.is_generic) continue; |
| 439 | 439 | |
| 440 | 440 | const dest_target = hash_kv.key; |