pub fn decode_u32(buf: &[u8; 5]) -> (u32, usize)
Expand description
Decodes a u32
from a buffer, returning the value and encoded length.
ยงExamples
let mut buf = [0u8; 5];
let encoded_len = vu128::encode_u32(&mut buf, 123);
assert_eq!(vu128::decode_u32(&buf), (123, encoded_len));