Last active
May 25, 2016 08:57
-
-
Save hashmaparraylist/898fad4ed5154007bc7014068d56b945 to your computer and use it in GitHub Desktop.
use node.js hash string. support sha1, md5 etc. `openssl list-message-digest-algorithms` will display the available digest algorithms.
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
| let crypto = require('crypto'); | |
| function hashString(algorithm, string) { | |
| return crypto.createHash(algorithm).update(string).digest('hex'); | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment