pub fn encode_bdx<T: AsRef<str>>(raw_input_str: T) -> Vec<u8> {
    let mut data: Vec<char> = raw_input_str.as_ref().chars().collect();
    if data.len() % 2 == 1 {
        data.push('0');
    }

    let input_length = data.len();
    let mut buffer = vec![0; input_length / 2];

    for i in (0..input_length).step_by(2) {
        let digit0: u8 = to_hex_digit(data.get(i));
        let digit1: u8 = to_hex_digit(data.get(i + 1));
        buffer[i / 2] = (digit0 << QUADBIT) + digit1;
    }

    buffer
}
/// Encodes a (hexa)decimal string into a binary buffer
Encodes a (hexa)decimal string into a binary buffer
Encodes a ( hexa ) decimal string into a binary buffer
pub fn encode_bdx<T: AsRef<str>>(raw_input_str: T) -> Vec<u8> {
    let mut data: Vec<char> = raw_input_str.as_ref().chars().collect();
    if data.len() % 2 == 1 {
        data.push('0');
    }
    let input_length = data.len();
    let mut buffer = vec![0; input_length / 2];
    for i in (0..input_length).step_by(2) {
        let digit0: u8 = to_hex_digit(data.get(i));
        let digit1: u8 = to_hex_digit(data.get(i + 1));
        buffer[i / 2] = (digit0 << QUADBIT) + digit1;
    }
    buffer
}
pub fn encode_bdx < T : AsRef < str > > ( raw_input_str : T ) -> Vec < u8 > { let mut data : Vec < char > = raw_input_str . as_ref ( ) . chars ( ) . collect ( ) ; if data . len ( ) % 2 == 1 { data . push ( '0' ) ; } let input_length = data . len ( ) ; let mut buffer = vec ! [ 0 input_length 2 ] ; for i in ( 0 .. input_length ) . step_by ( 2 ) { let digit0 : u8 = to_hex_digit ( data . get ( i ) ) ; let digit1 : u8 = to_hex_digit ( data . get ( i + 1 ) ) ; buffer [ i / 2 ] = ( digit0 << QUADBIT ) + digit1 ; } buffer }
Encodes a (hexa)decimal string into a binary buffer
Encodes a ( hexa ) decimal string into a binary buffer
raw_input_str
T
raw_input_str
T