Function domain::utils::base32::display_hex

source ยท
pub fn display_hex<B, W>(bytes: &B, f: &mut W) -> Result
where B: AsRef<[u8]> + ?Sized, W: Write,
Expand description

Encodes binary data in base32hex and writes it into a format stream.

This function is intended to be used in implementations of formatting traits:

use core::fmt;
use domain::utils::base32;

struct Foo<'a>(&'a [u8]);

impl<'a> fmt::Display for Foo<'a> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        base32::display_hex(&self.0, f)
    }
}