Function encode_unchecked

Source
pub fn encode_unchecked(str: &str) -> (Vec<u8>, usize)
Expand description

This function performs encoding without validating whether the input string contains only valid SIXBIT characters (ASCII 32-95). Use this function only when you are certain the input meets the required constraints to avoid undefined behavior.

§Safety

The caller must ensure that all characters in str are within the valid SIXBIT range (32-95).

§Examples

use dec_sixbit::encode_unchecked;

let input = "HELLO";
let (encoded_bytes, length) = encode_unchecked(input);