std/encoding/binary
Index
struct LittleEndian
fn PutU16(mut b: []byte, x: u16)
fn AppendU16(mut b: []byte, x: u16): []byte
fn DecodeU16(b: []byte): u16
fn PutU32(mut b: []byte, x: u32)
fn AppendU32(mut b: []byte, x: u32): []byte
fn DecodeU32(b: []byte): u32
fn PutU64(mut b: []byte, x: u64)
fn AppendU64(mut b: []byte, x: u64): []byte
fn DecodeU64(b: []byte): u64
struct BigEndian
fn PutU16(mut b: []byte, x: u16)
fn AppendU16(mut b: []byte, x: u16): []byte
fn DecodeU16(b: []byte): u16
fn PutU32(mut b: []byte, x: u32)
fn AppendU32(mut b: []byte, x: u32): []byte
fn DecodeU32(b: []byte): u32
fn PutU64(mut b: []byte, x: u64)
fn AppendU64(mut b: []byte, x: u64): []byte
fn DecodeU64(b: []byte): u64
LittleEndian
struct LittleEndian{}
Binary encoding implementation for little-endian order.
PutU16
fn PutU16(mut b: []byte, x: u16)
Encodes unsigned 16-bit integer into 2-bytes slice.
AppendU16
fn AppendU16(mut b: []byte, x: u16): []byte
Encodes unsigned 16-bit integer and appends to slice.
DecodeU16
fn DecodeU16(b: []byte): u16
Decodes unsigned 16-bit integer from 2-bytes.
PutU32
fn PutU32(mut b: []byte, x: u32)
Encodes unsigned 32-bit integer into 4-bytes slice.
AppendU32
fn AppendU32(mut b: []byte, x: u32): []byte
Encodes unsigned 32-bit integer and appends to slice.
DecodeU32
fn DecodeU32(b: []byte): u32
Decodes unsigned 32-bit integer from 4-bytes.
PutU64
fn PutU64(mut b: []byte, x: u64)
Encodes unsigned 64-bit integer into 8-bytes slice.
AppendU64
fn AppendU64(mut b: []byte, x: u64): []byte
Encodes unsigned 64-bit integer and appends to slice.
DecodeU64
fn DecodeU64(b: []byte): u64
Decodes unsigned 64-bit integer from 8-bytes.
BigEndian
struct BigEndian{}
Binary encoding implementation for big-endian order.
PutU16
fn PutU16(mut b: []byte, x: u16)
Encodes unsigned 16-bit integer into 2-bytes slice.
AppendU16
fn AppendU16(mut b: []byte, x: u16): []byte
Encodes unsigned 16-bit integer and appends to slice.
DecodeU16
fn DecodeU16(b: []byte): u16
Decodes unsigned 16-bit integer from 2-bytes.
PutU32
fn PutU32(mut b: []byte, x: u32)
Encodes unsigned 32-bit integer into 4-bytes slice.
AppendU32
fn AppendU32(mut b: []byte, x: u32): []byte
Encodes unsigned 32-bit integer and appends to slice.
DecodeU32
fn DecodeU32(b: []byte): u32
Decodes unsigned 32-bit integer from 4-bytes.
PutU64
fn PutU64(mut b: []byte, x: u64)
Encodes unsigned 64-bit integer into 8-bytes slice.
AppendU64
fn AppendU64(mut b: []byte, x: u64): []byte
Encodes unsigned 64-bit integer and appends to slice.
DecodeU64
fn DecodeU64(b: []byte): u64
Decodes unsigned 64-bit integer from 8-bytes.