Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding a hash method to underscore.string.js #247
A hash method for underscore.string.js
I needed a string-to-hash method for my current project to create keys for strings and to add a simple password check without transferring the password as plain text to the server. I think this hash method for strings fits perfectly with underscore.string - actually, I was a bit surprised that it did not exist already, neither here nor in underscore.js.
About the added method:
Hmmm, I do not really care what method is used internally - what ever is more efficient. But the suggested one is compatible with Java. I did not check if the Java way produces the same result as sha1 or md5, though. But i agree that it is a good idea to stick with standards like sha1 and md5. Nevertheless, it would be nice and handy to have this kind of method to be part of underscore.string.js. :)