Skip to content
CryoCryo home
Stdlibencoding

hex

import std::encoding::hex; · source

Free Functions

function encode(bytes: &Slice<u8>) -> String;

bytes as lowercase hexadecimal, two digits per byte.

Two lowercase digits per byte, most significant nibble first: [0x0f, 0xa0] is 0fa0.

import std::encoding::hex;

const digest: Str = "hi";
const text: String = hex::encode(digest.as_bytes());   // "6869"

Constants

const DIGITS: string = "0123456789abcdef";