generated from PlexSheep/rs-base
add parser for all formats #13
|
@ -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) => {
|
||||||
PlexSheep marked this conversation as resolved
|
|||||||
let e = format!("{e}");
|
let e = format!("{e}");
|
||||||
Err(anyhow!(e))
|
Err(anyhow!(e))
|
||||||
|
|
Reference in New Issue
use libpt here too!