decode_bcd

Function decode_bcd 

Source
pub fn decode_bcd(c: char) -> u8
Expand description

Translate a binary representation to u8 using the bcd encoding

bcd: binary coded decimal

TensOnes
n/a8
644
322
161
use bbd_lib::*;

assert_eq!(
    "\
        ⠀⢀⠠⢠⠐⢐⠰⢰⠈⢈⡀⣀⡠⣠⡐⣐⡰⣰⡈⣈⠄⢄⠤⢤⠔⢔⠴⢴⠌⢌⡄⣄⡤⣤⡔⣔⡴⣴⡌⣌⠂⢂⠢⢢⠒⢒⠲⢲⠊⢊\
        ⡂⣂⡢⣢⡒⣒⡲⣲⡊⣊⠆⢆⠦⢦⠖⢖⠶⢶⠎⢎⡆⣆⡦⣦⡖⣖⡶⣶⡎⣎⠁⢁⠡⢡⠑⢑⠱⢱⠉⢉⡁⣁⡡⣡⡑⣑⡱⣱⡉⣉\
    ".chars().map(|x| decode_bcd(x)).collect::<Vec<u8>>(),
    (0..=99).collect::<Vec<u8>>(),
);