pub fn encode_u64(buf: &mut [u8; 9], value: u64) -> usize
Expand description
Encodes a u64
into a buffer, returning the encoded length.
The contents of the buffer beyond the returned length are unspecified.
ยงExamples
let mut buf = [0u8; 9];
let encoded_len = vu128::encode_u64(&mut buf, 12345);
assert_eq!(&buf[..encoded_len], &[0xB9, 0xC0]);