speps / go-hashids

Go (golang) implementation of http://www.hashids.org
MIT License
1.32k stars 109 forks source link

hashing uuids? #27

Closed matthewmueller closed 7 years ago

matthewmueller commented 7 years ago

I saw that hashid intentionally doesn't support encoding strings because it's not secure, but I was wondering about hashing uuids as a way to shorten them (not for security). is that possible with this library? thanks!

speps commented 7 years ago

I don't really get what you want, UUIDs are already numbers, totalling 128 bits IIRC, but in text form. So you might as well encode this into a hashid :)

matthewmueller commented 7 years ago

Hey, thanks for your response!

What I was looking to do was take my database ID (a UUID) and make a short code for it using hash id.

IIRC, I realized that hashids != short ids, meaning that if i turn a UUID from base64 to base10 and then pass it into the hashid function, it'll still be a huge hash haha.