Skip to main content

Module bytes

Module bytes 

Source
Expand description

Bounds-checked little-endian readers (panic-free on crafted offsets).

Registry cells are untrusted input; an out-of-range read yields a zero value instead of an out-of-bounds slice panic, keeping the parser panic-free even if a caller’s bounds guard is ever broken (defence-in-depth).

Functions§

le_u32
Read a little-endian u32 at off, or 0 if off..off+4 is out of range.
read4
Read 4 raw bytes at off, or [0; 4] if off..off+4 is out of range.