mirror of https://github.com/tycrek/ass
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
197 B
2 lines
197 B
3 years ago
|
const { randomBytes } = require('crypto');
|
||
|
module.exports = (length, charset) => [...randomBytes(length)].map((byte) => charset[Number(byte) % charset.length]).join('').slice(1).concat(charset[0]);
|