iftechfoundation / ifarchive-unbox

IF Archive Unboxing service
https://unbox.ifarchive.org
MIT License
1 stars 2 forks source link

Use the base36 string as the hash key instead of int #33

Closed erkyrath closed 2 years ago

erkyrath commented 2 years ago

This tidies up a lot of "toString(36)" calls and makes everything easier to read.

I've also ensured that the hash string is exactly 10 chars.

Also added a couple of log lines to improve visibility.

curiousdannii commented 2 years ago

This raises the size of the Map keys from 8 to 20 bytes, which is why I didn't originally do something like this. Well also the speed of the Maps hashing a string compared to an int. But that's unlikely to actually be a problem, and it does make things considerably simpler, so I agree it's a worthwhile trade-off. Thanks for the PR!

Note that a URL like https://unbox.ifarchive.org/7forkl5y7/%D0%BF%D1%80%D0%BE%D1%85%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5.txt (with a 9 char hash) will break. So the right time to do this is now, before the public launch.