std/binary
On this page
Index
- fn
u16_be - fn
u32_be - fn
u64_be - fn
u16_le - fn
u32_le - fn
u64_le - fn
get_u16_be - fn
get_u32_be - fn
get_u64_be - fn
get_u16_le - fn
get_u32_le - fn
get_u64_le - fn
get_i16_be - fn
get_i32_be - fn
get_i16_le - fn
get_i32_le - fn
uvarint - fn
varint - fn
get_uvarint - fn
get_varint
Functions
u16_be
fn u16_be(n: Int) -> BytesThe low 16 bits of n, big endian (2 bytes); also the 32 (4 bytes) and 64 bit (8 bytes) forms and little endian ones.
u32_be
fn u32_be(n: Int) -> Bytesu64_be
fn u64_be(n: Int) -> Bytesu16_le
fn u16_le(n: Int) -> Bytesu32_le
fn u32_le(n: Int) -> Bytesu64_le
fn u64_le(n: Int) -> Bytesget_u16_be
fn get_u16_be(b: Bytes, at: Int) -> IntThe unsigned 16 bit value at byte at, big endian; faults when the bytes run past the end. Also the 32 and 64 bit and little endian forms.
get_u32_be
fn get_u32_be(b: Bytes, at: Int) -> Intget_u64_be
fn get_u64_be(b: Bytes, at: Int) -> Intget_u16_le
fn get_u16_le(b: Bytes, at: Int) -> Intget_u32_le
fn get_u32_le(b: Bytes, at: Int) -> Intget_u64_le
fn get_u64_le(b: Bytes, at: Int) -> Intget_i16_be
fn get_i16_be(b: Bytes, at: Int) -> IntThe same, sign extended (Go’s int16(binary.BigEndian.Uint16(b))).
get_i32_be
fn get_i32_be(b: Bytes, at: Int) -> Intget_i16_le
fn get_i16_le(b: Bytes, at: Int) -> Intget_i32_le
fn get_i32_le(b: Bytes, at: Int) -> Intuvarint
fn uvarint(n: Int) -> Bytesn as an unsigned 64 bit word in the varint encoding (binary.AppendUvarint).
varint
fn varint(n: Int) -> Bytesn zig-zag encoded (binary.AppendVarint).
get_uvarint
fn get_uvarint(b: Bytes, at: Int) -> (Int, Int)?The value at byte at and the bytes it took; None when the input ends first or the value overflows 64 bits (binary.Uvarint’s n <= 0).
get_varint
fn get_varint(b: Bytes, at: Int) -> (Int, Int)?