refactor: use libpt for joining the base64 parser vec #5 #13
cargo devel CI / cargo CI (push) Successful in 1m24s Details

This commit is contained in:
Christoph J. Scherr 2024-05-13 15:52:18 +02:00
parent 1bb0ffd6f8
commit 7eb00e0f56
1 changed files with 1 additions and 12 deletions

View File

@ -306,18 +306,7 @@ where
None => s, None => s,
}; };
match fast32::base64::RFC4648.decode_str(s) { match fast32::base64::RFC4648.decode_str(s) {
Ok(r) => { Ok(r) => Ok(join::array_to_unsigned::<T>(&r)?),
if r.len() > 16 {
panic!("boom");
}
let mut ri: u128 = 0;
for (i, e) in r.iter().rev().enumerate() {
ri += (*e as u128) * 256.pow(i as u32) as u128;
}
dbg!(ri);
dbg!(format!("{ri:#x}"));
Ok(ri.to_string().parse().unwrap())
}
Err(e) => { Err(e) => {
let e = format!("{e}"); let e = format!("{e}");
Err(anyhow!(e)) Err(anyhow!(e))