Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

hash3

Private Function
std.hash.xxhash.XxHash3.hash3
fn hash3(seed: u64, input: anytype, noalias secret: *const [192]u8) u64

Params

  • seed: u64
  • input
  • secret: *const [192]u8

File

hash/xxhash.zig:602
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);
    }