pad.libre-service.eu-etherpad/src/node/utils/randomstring.js

12 lines
275 B
JavaScript
Raw Normal View History

2012-01-28 13:24:58 +01:00
/**
* Generates a random String with the given length. Is needed to generate the Author, Group, readonly, session Ids
*/
var crypto = require('crypto');
2014-01-24 01:19:14 +01:00
var randomString = function(len)
2012-01-28 13:24:58 +01:00
{
2014-01-24 01:19:14 +01:00
return crypto.randomBytes(len).toString('hex')
2012-01-28 13:24:58 +01:00
};
module.exports = randomString;