You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for raising. This library is a very thin wrapper around bs58-rs so I'm not sure if there's anything that can be done on our side, but I'll leave this open in case anyone has any ideas
for byte in&mut output[..index]{
val += (*byte asusize)*58;*byte = (val &0xFF)asu8;
val >>= 8;}
Using rug or num_bigint would almost certainly be better. rug has an unsafe method, assign_bytes_radix_unchecked(), and num_bigint has from_radix_be(). I expect assign_bytes_radix_unchecked() would be faster for very large inputs, but I don't know what additional input cleaning of the input would be required.
let translated_input = vec![1u8,1,1];let b58_biguint = BigUint::from_radix_be(&translated_input,58).unwrap();let decoded_vec = b58_biguint.to_bytes_be();assert_eq!(decoded_vec,"\r_".as_bytes());
Cleaning the input once, using BigUint, and moving the data back into the output appears to significantly faster for the 256_bytes/decode_bs58 benchmark.
I am having performance issues decoding large inputs (>10KB). The issue may be with
bs58-rs
, not this project.I don't know if there is a base58 project that uses rug or similar for better large integer performance.
The text was updated successfully, but these errors were encountered: