angleman / md564

Base64 MD5 of strings and JSON, where JSON attributes are sorted before comparison for consistent results

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

md564

Base64 MD5 of strings and JSON, where JSON attributes are sorted before comparison for consistent results

Install πŸ”¨

npm install md564

Usage πŸ’‘

md564 = new require('md564')
console.log(MD564('hello'))        // 1TGK0fk4hfTgamcP4G5xMI
obj1  = {bar: 'grill', foo: 'man'}
obj2  = {foo: 'man', bar: 'grill'}
console.log(MD564(obj1, true))    // 3MEEOkTwl6NBNuzrYVpHeX
console.log(MD564(obj2))          // 0_8LeiEkKgp~Kwo5qV15E1
console.log(MD564(obj2, true))    // 3MEEOkTwl6NBNuzrYVpHeX

If param2 is true then the object attributes will be sorted prior to being made into a string and obtaining the MD5 value.

Contributions πŸ’ͺ

πŸ˜„ Feedback, problem reports, enhancement requests are welcome.

πŸ†™ Example code are better.

πŸ†’ Pull requests are best.

License

MIT

About

Base64 MD5 of strings and JSON, where JSON attributes are sorted before comparison for consistent results

License:MIT License


Languages

Language:JavaScript 100.0%