ByteArray.
Signature
Trait functions
format_as_byte_array
Returns a newByteArray containing the ASCII representation of the value.
ByteArray.
pub trait FormatAsByteArray
ByteArray containing the ASCII representation of the value.
fn format_as_byte_array(self: @T, base: NonZero) -> ByteArray
use core::to_byte_array::FormatAsByteArray;
let num: u32 = 42;
let formatted = num.format_as_byte_array(16);
assert!(formatted, "2a");
Was this page helpful?