A trait for formatting values into their ASCII string representation in a ByteArray.

Signature

pub trait FormatAsByteArray

Trait functions

format_as_byte_array

Returns a new ByteArray containing the ASCII representation of the value.

Signature

fn format_as_byte_array(self: @T, base: NonZero) -> ByteArray

Examples

use core::to_byte_array::FormatAsByteArray;

let num: u32 = 42;
let formatted = num.format_as_byte_array(16);
assert!(formatted, "2a");