Skip to main content

encode_size

Function encode_size 

Source
pub fn encode_size(size: usize, is_be: bool) -> Vec<u8> 
Expand description

Encode a variable-length integer (PVA size encoding).

Values 0..253 are stored as a single byte. Values >= 254 are stored as 0xFE followed by a 4-byte u32.