fn hash3(seed: u64, input: anytype, noalias secret: *const [192]u8) u64
seed: u64
input
secret: *const [192]u8
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
fn hash3(seed: u64, input: anytype, noalias secret: *const [192]u8) u64 { @branchHint(.unlikely); std.debug.assert(input.len > 0 and input.len < 4); const flip: [2]u32 = @bitCast(secret[0..8].*); const blk: u32 = @bitCast([_]u8{ input[input.len - 1], @truncate(input.len), input[0], input[input.len / 2], }); const key = @as(u64, flip[0] ^ flip[1]) +% seed; return avalanche(.h64, key ^ blk); }