encode

Function encode 

Source
pub fn encode<T>(i: &T) -> Vec<u8> 
where T: PrimInt + Unsigned + Copy,
Expand description

Encode an integer into a variable-length byte array.

§Example

use vbe::encode;
let res: Vec<u8> = encode(&22u32);
assert_eq!(res, vec![22u8 | 0x80]);