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

11 lines
281 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
*/
2020-11-23 19:24:19 +01:00
const crypto = require('crypto');
2020-11-23 19:24:19 +01:00
const randomString = function (len) {
return crypto.randomBytes(len).toString('hex');
2012-01-28 13:24:58 +01:00
};
module.exports = randomString;