fn encode_bubblebabble(bytes: &[u8]) -> Vec<u8> {
    let vowels = b"aeiouy";
    let consonants = b"bcdfghklmnprstvzx";

    let mut result = Vec::new();
    let mut c: usize = 1;

    result.push(b'x');

    #[allow(unknown_lints, needless_range_loop)]
    for i in 0..(bytes.len() + 1) {
        if i % 2 != 0 {
            continue;
        }

        if i >= bytes.len() {
            result.push(vowels[c % 6]);
            result.push(consonants[16]);
            result.push(vowels[c / 6]);
            break;
        }

        let byte1 = bytes[i] as usize;
        result.push(vowels[(((byte1 >> 6) & 3) + c) % 6]);
        result.push(consonants[(byte1 >> 2) & 15]);
        result.push(vowels[((byte1 & 3) + (c / 6)) % 6]);

        if i + 1 >= bytes.len() {
            break;
        }

        let byte2 = bytes[i + 1] as usize;
        result.push(consonants[(byte2 >> 4) & 15]);
        result.push(b'-');
        result.push(consonants[byte2 & 15]);

        c = (c * 5 + byte1 * 7 + byte2) % 36;
    }

    result.push(b'x');
    result
}
/// Encode random data with the Bubble Babble encoding
Encode random data with the Bubble Babble encoding
Encode random data with the Bubble Babble encoding
fn encode_bubblebabble(bytes: &[u8]) -> Vec<u8> {
    let vowels = b"aeiouy";
    let consonants = b"bcdfghklmnprstvzx";
    let mut result = Vec::new();
    let mut c: usize = 1;
    result.push(b'x');
    #[allow(unknown_lints, needless_range_loop)]
    for i in 0..(bytes.len() + 1) {
        if i % 2 != 0 {
            continue;
        }
        if i >= bytes.len() {
            result.push(vowels[c % 6]);
            result.push(consonants[16]);
            result.push(vowels[c / 6]);
            break;
        }
        let byte1 = bytes[i] as usize;
        result.push(vowels[(((byte1 >> 6) & 3) + c) % 6]);
        result.push(consonants[(byte1 >> 2) & 15]);
        result.push(vowels[((byte1 & 3) + (c / 6)) % 6]);
        if i + 1 >= bytes.len() {
            break;
        }
        let byte2 = bytes[i + 1] as usize;
        result.push(consonants[(byte2 >> 4) & 15]);
        result.push(b'-');
        result.push(consonants[byte2 & 15]);
        c = (c * 5 + byte1 * 7 + byte2) % 36;
    }
    result.push(b'x');
    result
}
fn encode_bubblebabble ( bytes : & [ u8 ] ) -> Vec < u8 > { let vowels = b" " ; let consonants = b" " ; let mut result = Vec :: new ( ) ; let mut c : usize = 1 ; result . push ( b'x' ) ; # [ allow ( unknown_lints needless_range_loop ) ] for i in 0 .. ( bytes . len ( ) + 1 ) { if i % 2 != 0 { continue ; } if i >= bytes . len ( ) { result . push ( vowels [ c % 6 ] ) ; result . push ( consonants [ 16 ] ) ; result . push ( vowels [ c / 6 ] ) ; break ; } let byte1 = bytes [ i ] as usize ; result . push ( vowels [ ( ( ( byte1 >> 6 ) & 3 ) + c ) % 6 ] ) ; result . push ( consonants [ ( byte1 >> 2 ) & 15 ] ) ; result . push ( vowels [ ( ( byte1 & 3 ) + ( c / 6 ) ) % 6 ] ) ; if i + 1 >= bytes . len ( ) { break ; } let byte2 = bytes [ i + 1 ] as usize ; result . push ( consonants [ ( byte2 >> 4 ) & 15 ] ) ; result . push ( b'-' ) ; result . push ( consonants [ byte2 & 15 ] ) ; c = ( c * 5 + byte1 * 7 + byte2 ) % 36 ; } result . push ( b'x' ) ; result }
Encode random data with the Bubble Babble encoding
Encode random data with the Bubble Babble encoding
bytes
&[u8]
bytes
&[u8]