Created
April 7, 2015 06:00
-
-
Save naosim/1f511874ccec59a62773 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MD5 = function() { | |
var crypto = require('crypto'); | |
return { | |
hex: function(src) { | |
var md5 = crypto.createHash('md5'); | |
md5.update(src, 'utf8'); | |
return md5.digest('hex'); | |
} | |
}; | |
}; | |
if (require.main === module) { | |
console.log(MD5().hex(process.argv[2])); | |
} else { | |
module.exports = MD5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from console
from program