[][src]Function rusty_ulid::crockford::append_crockford_u128

pub fn append_crockford_u128(value: u128, to_append_to: &mut String)

Appends the crockford Base32 representation of the u128 to to_append_to.

Examples

let mut a_string = String::new();
append_crockford_u128(1, &mut a_string);
assert_eq!(a_string, "00000000000000000000000001");
let mut a_string = String::new();
append_crockford_u128(0xFF, &mut a_string);
assert_eq!(a_string, "0000000000000000000000007Z");
let mut a_string = String::new();
append_crockford_u128(0xFFFF_FFFF_FFFF_FFFF, &mut a_string);
assert_eq!(a_string, "0000000000000FZZZZZZZZZZZZ");
let mut a_string = String::new();
append_crockford_u128(0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF, &mut a_string);
assert_eq!(a_string, "7ZZZZZZZZZZZZZZZZZZZZZZZZZ");