Skip to main content

decode_n

Function decode_n 

Source
pub const fn decode_n<const N: usize>(src: &[u8; N]) -> Option<Array<N>>
Expand description

Decodes a fixed-size base32_dns array with padding.

§Arguments

  • src - The encoded byte array to decode

§Returns

A Result containing the decoded byte array or an error.

§Example

use omp_core::base32_dns;
let data = [0x48u8, 0x65, 0x6c, 0x6c, 0x6f];
let encoded = base32_dns::encode(&data).into_vec();
let decoded = base32_dns::decode(&encoded).into_vec().unwrap();
assert_eq!(&decoded, &data);