I was doing some performance testing with @Dr-Emann's version of this (can't get the normal version to run?) and it looks like it's not able to decode things encoded with padding.
Sample code:
let hashid = HashIds::new("this is my salt".into()).unwrap();
let encoded_values: Vec<_> = (1..1001).map(|n| hashid.encode(&[n])).collect();
for value in encoded_values.iter().map(|s| (s, hashid.decode(s))) {
println!("{:?}", value);
}
I was doing some performance testing with @Dr-Emann's version of this (can't get the normal version to run?) and it looks like it's not able to decode things encoded with padding.
Sample code: