docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

core::encoding::hex

base16 (RFC 4648 section 8): two digits per byte. Decoding takes either case.

Enums

CaseSource

pub enum Case

The case of the digits a to f that encode writes.

Functions

encodeSource

pub fn encode<B: AsBytes>(data: B, case: Case = Case::Lower) -> str

data in hex, two digits per byte.

encode_intoSource

pub fn encode_into<B: AsBytes>(data: B, out: SliceMut<u8>, case: Case = Case::Lower) -> usize

data in hex, written to the front of out; returns how many bytes it wrote (2 * data.len()). Panics if out is shorter.

decodeSource

pub fn decode<B: AsBytes>(text: B) throws (DecodeError) -> List<u8>

The bytes text spells in hex, two digits each (either case).

decode_intoSource

pub fn decode_into<B: AsBytes>(text: B, out: SliceMut<u8>) throws (DecodeError) -> usize

The bytes text spells in hex, written to the front of out; returns how many it wrote (text.len() / 2). Panics if out is shorter.