Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

encode_u8_array

Encodes a byte array into Base58 format using the specified character set

This function implements Base58 encoding by treating the input bytes as a big integer and repeatedly dividing by 58 to get the Base58 digits. Leading zero bytes are preserved as leading ‘1’ characters in the output. The algorithm uses “big integer division” to avoid overflow during the conversion process.

Arguments

  • bytes - Span of bytes to encode
  • base58_chars - Span containing the 58-character Base58 alphabet to use

Returns

  • Array<u8> - The Base58 encoded result as an array of character bytes

Fully qualified path: alexandria_encoding::base58::encode_u8_array

pub fn encode_u8_array(bytes: Span<u8>, base58_chars: Span<u8>) -> Array<u8>