pub struct Base32HexNoPadding;Expand description
Base32 Hex encoder and decoder without padding.
This implementation follows the Base32hex encoding variant as defined in RFC 4648, but omits padding characters (‘=’). This is particularly useful for identifiers and other cases where the padding is unnecessary.
§Examples
use ct_codecs::{Base32HexNoPadding, Encoder, Decoder};
fn example() -> Result<(), ct_codecs::Error> {
let data = b"foobar";
let encoded = Base32HexNoPadding::encode_to_string(data)?;
assert_eq!(encoded, "CPNMUOJ1E8");
let decoded = Base32HexNoPadding::decode_to_vec(&encoded, None)?;
assert_eq!(decoded, data);
Ok(())
}Trait Implementations§
Source§impl Decoder for Base32HexNoPadding
impl Decoder for Base32HexNoPadding
Source§impl Encoder for Base32HexNoPadding
impl Encoder for Base32HexNoPadding
Source§fn encoded_len(bin_len: usize) -> Result<usize, Error>
fn encoded_len(bin_len: usize) -> Result<usize, Error>
Calculates the length of the encoded output for a given binary input length. Read more
Source§fn encode<IN: AsRef<[u8]>>(b32: &mut [u8], bin: IN) -> Result<&[u8], Error>
fn encode<IN: AsRef<[u8]>>(b32: &mut [u8], bin: IN) -> Result<&[u8], Error>
Encodes binary data into a text representation. Read more
Auto Trait Implementations§
impl Freeze for Base32HexNoPadding
impl RefUnwindSafe for Base32HexNoPadding
impl Send for Base32HexNoPadding
impl Sync for Base32HexNoPadding
impl Unpin for Base32HexNoPadding
impl UnsafeUnpin for Base32HexNoPadding
impl UnwindSafe for Base32HexNoPadding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more