speps / go-hashids

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

Where's the curse word protection? #4

Closed verkestk closed 10 years ago

verkestk commented 10 years ago

I don't see the curse word protection implemented. Am I missing something? Or maybe it's planned for later? In my testing with a non-default alphabet, I was seeing letter sequences that the hashids.org website says will not occur. The hashids.org website has the following in the documentation:

%@&


This code was written with the intent of placing generated hashes in visible places - like the URL.

Therefore, the algorithm tries to avoid generating most common English curse words by never placing the following letters next to each other:

c, C, s, S, f, F, h, H, u, U, i, I, t, T

speps commented 10 years ago

No I don't remember this part from the PHP implementation that I took inspiration from if I remember correctly. Feel free to add it, I don't have much time to spend on this so it might take a while to get it.

speps commented 10 years ago

This has been added as part of the update to Hashids 1.0.0.