Created
October 24, 2012 03:27
-
-
Save clonn/3943507 to your computer and use it in GitHub Desktop.
encrypt md5/ sha1 by node.js
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 connect = require('connect'); | |
var uid = connect.utils.uid(20); | |
console.log('origin uid: ' + uid); | |
var crypto = require('crypto'); | |
var sha1 = crypto.createHash('sha1'); | |
var d = sha1.update(uid).digest('hex'); | |
console.log('encrypt uid(sha1): ' + d); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment