std/binary
Functions
u16Be
pub pure fn u16Be(data: Bytes, at: usize) -> u16?
Fixed-width and variable-width integers inside a byte string, most- or least-significant byte first. Every reader returns None rather than panicking when the range runs past the end, so a parser can decide.
The two bytes at at, most-significant first; None past the end.
u32Be
pub pure fn u32Be(data: Bytes, at: usize) -> u32?
The four bytes at at, most-significant first; None past the end.
u64Be
pub pure fn u64Be(data: Bytes, at: usize) -> u64?
The eight bytes at at, most-significant first; None past the end.
u16Le
pub pure fn u16Le(data: Bytes, at: usize) -> u16?
The two bytes at at, least-significant first; None past the end.
u32Le
pub pure fn u32Le(data: Bytes, at: usize) -> u32?
The four bytes at at, least-significant first; None past the end.
u64Le
pub pure fn u64Le(data: Bytes, at: usize) -> u64?
The eight bytes at at, least-significant first; None past the end.
uintBe
pub pure fn uintBe(data: Bytes, at: usize, n: usize) -> u64?
n bytes at at, most-significant first; None past the end or for n > 8.
uintLe
pub pure fn uintLe(data: Bytes, at: usize, n: usize) -> u64?
n bytes at at, least-significant first; None past the end or for n > 8.
putUintBe
pub pure fn putUintBe(out: &mut Array[u8], v: u64, n: usize)
Appends the low n bytes of v, most-significant first. n above 8 pads with leading zeroes.
putUintLe
pub pure fn putUintLe(out: &mut Array[u8], v: u64, n: usize)
Appends the low n bytes of v, least-significant first. n above 8 pads with trailing zeroes.
putU16Be
pub pure fn putU16Be(out: &mut Array[u8], v: u16)
Appends v as two bytes, most-significant first.
putU32Be
pub pure fn putU32Be(out: &mut Array[u8], v: u32)
Appends v as four bytes, most-significant first.
putU64Be
pub pure fn putU64Be(out: &mut Array[u8], v: u64)
Appends v as eight bytes, most-significant first.
putU16Le
pub pure fn putU16Le(out: &mut Array[u8], v: u16)
Appends v as two bytes, least-significant first.
putU32Le
pub pure fn putU32Le(out: &mut Array[u8], v: u32)
Appends v as four bytes, least-significant first.
putU64Le
pub pure fn putU64Le(out: &mut Array[u8], v: u64)
Appends v as eight bytes, least-significant first.