fn hash16(seed: u64, input: anytype, noalias secret: *const [192]u8) u64 seed: u64inputsecret: *const [192]u8634
635
636
637
638
639
640
641
642
643
644
645
646
647
648 fn hash16(seed: u64, input: anytype, noalias secret: *const [192]u8) u64 {
@branchHint(.unlikely);
std.debug.assert(input.len > 8 and input.len <= 16);
const flip: [4]u64 = @bitCast(secret[24..56].*);
const blk: [2]u64 = @bitCast([_][8]u8{
input[0..8].*,
input[input.len - 8 ..][0..8].*,
});
const lo = blk[0] ^ ((flip[0] ^ flip[1]) +% seed);
const hi = blk[1] ^ ((flip[2] ^ flip[3]) -% seed);
const combined = @as(u64, input.len) +% @byteSwap(lo) +% hi +% fold(lo, hi);
return avalanche(.h3, combined);
}