A simple MD2 hash function for JavaScript supports UTF-8 encoding.
npm install js-md2JavaScript
md2('Message to hash');
`
If you use node.js, you should require the module first:
`JavaScript
var md2 = require('js-md2');
`
If you use require.js, you should require the module first:
`JavaScript
require(['md2.js'], function (md2) {
// ...
});
`
Example
`JavaScript
md2(''); // 8350e5a3e24c153df2275c9f80692773
md2('The quick brown fox jumps over the lazy dog'); // 03d85a0d629d2c442e987525319fc471
md2('The quick brown fox jumps over the lazy dog.'); // 71eaa7e440b611e41a6f0d97384b342a
// It also supports UTF-8 encoding
md2('中文'); // 7af93c270b0ec392ca2f0d90a927cf8a
``