Skip to main content

Module scan

Module scan 

Source
Expand description

Byte search and field-value validation, eight bytes per step.

The fast paths read the input as little-endian u64 words and use the classic “has zero byte” bit trick (SWAR: SIMD within a register), with no unsafe. Each one agrees with the bytewise definition for every byte at every position; the tests and property tests check exactly that.

Functions§

check_field_value
Validates a field value per RFC 9110 section 5.5: every byte is field-vchar, SP, HTAB, or obs-text.
find_byte
The index of the first needle in hay.
find_either
The index of the first byte in hay that equals a or b.
first_not_in
The index of the first byte of s outside class.