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

11 lines
278 B
JavaScript
Raw Normal View History

2021-01-21 22:06:52 +01:00
'use strict';
2012-01-28 13:24:58 +01:00
/**
2021-01-21 22:06:52 +01:00
* Generates a random String with the given length. Is needed to generate the
* Author, Group, readonly, session Ids
2012-01-28 13:24:58 +01:00
*/
2020-11-23 19:24:19 +01:00
const crypto = require('crypto');
2021-01-21 22:06:52 +01:00
const randomString = (len) => crypto.randomBytes(len).toString('hex');
2012-01-28 13:24:58 +01:00
module.exports = randomString;