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

consume

Private Function
std.hash.xxhash.XxHash3.Accumulator.consume
fn consume(noalias self: *Accumulator, input_blocks: []const InputBlock) void

Params

File

hash/xxhash.zig:552
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
        fn consume(noalias self: *Accumulator, input_blocks: []const InputBlock) void {
            const blocks_per_scramble = 1024 / block_bytes;
            std.debug.assert(self.consumed <= blocks_per_scramble);

            var blocks = input_blocks;
            var blocks_until_scramble = blocks_per_scramble - self.consumed;
            while (blocks.len >= blocks_until_scramble) {
                self.accumulate(blocks[0..blocks_until_scramble]);
                self.scramble();

                self.consumed = 0;
                blocks = blocks[blocks_until_scramble..];
                blocks_until_scramble = blocks_per_scramble;
            }

            self.accumulate(blocks);
            self.consumed += blocks.len;
        }