Skip to main content

decode_mut

Function decode_mut 

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

Decodes base64 encoded bytes into a mutable buffer with 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::base64;
let mut buf = [0u8; 10];
let encoded = base64::encode(b"hello").into_vec();
let n = base64::decode_mut(&encoded, &mut buf).unwrap();