Expand description

Utilities for packing unsigned integers to Vec<u8>s of appropriate size.

Functions

Packs a u8 to a 1-byte Vec.

Packs a u16 to a 2-byte Vec.

Packs a u32 to a 4-byte Vec.

Packs a u64 to an 8-byte Vec.

Automatically packs an integer in a context sensitive way. Returns None if the passed integer is too large to be casted down.

Unpacks a 1 byte Vec to a u8.

Unpacks a 2 byte Vec to a u16.

Unpacks a 4 byte Vec to a u32.

Unpacks an 8 byte Vec to a u64.

Automatically unpacks a buffer to an integer in a context sensitive way.