gemlikes
gemlikes copied to clipboard
Use salt when generating ids from ips
Implemented salting for IP addresses, per #6
I made the default behavior to create a new salt file, but that means that old installations which upgrade need to set the setting to "disabled" to retain the old behavior, which might not be what you want.
Thanks for adding this! Two things: As I told someone in #7, please make the salt config option a global variable rather than parsing the config file again. Secondly, don't ready from the salt file every time the function is called, that's inefficient. Just do all the salting logic in the Init and have a global salt variable.
Okay, yeah, I don't have a good excuse for why I implemented it that way. I'm gonna chalk it up to having an off day :sweat:
It now sets up a slice during init, leaving it empty if salting is disabled.
Oh, and I changed the permissions on the salt file to 0644, to match the permissions used elsewhere.
Sorry for leaving this for so long. This project is not a top priority for me, as it's more of toy. But anyway I'm happy to merge this, just have one comment, see above.
@jdpage any interest in finishing this up?