Zig's HashMap - Part 3

from blog openmymind.net, | ↗ original
Previously On... In Part 1 we saw how Zig's StringHashMap and AutoHashMap are wrappers around a HashMap. HashMap works across different key types by requiring a Context. Here's the built-in context that StringHashMap uses: pub const StringContext = struct { pub fn hash(_: StringContext, s: []const u8) u64 { return std.hash.Wyhash.hash(0,...