Skip to main content

decode_raw_n

Function decode_raw_n 

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

Decodes a fixed-size base32 array without 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;
let data = [0x48u8, 0x65, 0x6c, 0x6c, 0x6f];
let encoded = base32::encode_raw(&data).into_vec();
let decoded = base32::decode_raw(&encoded).into_vec().unwrap();
assert_eq!(&decoded, &data);