docs

core::encoding::hex

API 参考只有英文版,由标准库源代码中的英文文档注释生成。

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.