Function ion_rs::binary::uint::encode_u64

source ·
pub fn encode_u64(magnitude: u64) -> EncodedUInt
Expand description

Returns the magnitude as big-endian bytes.

use ion_rs::binary::uint;

let repr = uint::encode_u64(5u64);
assert_eq!(&[0x05], repr.as_bytes());

let two_bytes = uint::encode_u64(256u64);
assert_eq!(&[0x01, 0x00], two_bytes.as_bytes());