fix randomstring

This commit is contained in:
webzwo0i 2014-01-24 01:19:14 +01:00
parent e4fbf4bbcd
commit a43123880a

View file

@ -3,11 +3,9 @@
*/ */
var crypto = require('crypto'); var crypto = require('crypto');
var randomString = function randomString(len) var randomString = function(len)
{ {
crypto.randomBytes(len, function(ex, buf) { return crypto.randomBytes(len).toString('hex')
return buf.toString('hex');
});
}; };
module.exports = randomString; module.exports = randomString;