Skip to main content

decode_raw_mut

Function decode_raw_mut 

Source
pub const fn decode_raw_mut(src: &[u8], dst: &mut [u8]) -> Result<usize>
Expand description

Decodes base32_hex encoded bytes into a mutable buffer without padding.

§Arguments

  • src - The encoded byte slice to decode
  • dst - The mutable buffer to write decoded bytes to

§Returns

The number of bytes written to dst, or an error if decoding failed.

§Example

use omp_core::base32_hex;
let mut buf = [0u8; 10];
let encoded = base32_hex::encode_raw(b"hello").into_vec();
let n = base32_hex::decode_raw_mut(&encoded, &mut buf).unwrap();