mirror of https://github.com/tycrek/ass
parent
9a1e1d7b00
commit
1063cc6117
@ -1,3 +1,3 @@
|
|||||||
const { randomBytes } = require('crypto');
|
const { randomBytes } = require('crypto');
|
||||||
const zeroWidthChars = ['\u200B', '\u200C', '\u200D', '\u2060', '\u180E'];
|
const zeroWidthChars = ['\u200B', '\u200C', '\u200D', '\u2060'];
|
||||||
module.exports = (size) => [...randomBytes(size)].map(byte => zeroWidthChars[+byte % zeroWidthChars.length]).join('').slice(1) + zeroWidthChars[0];
|
module.exports = (size) => [...randomBytes(size)].map(byte => zeroWidthChars[+byte % zeroWidthChars.length]).join('').slice(1) + zeroWidthChars[0];
|
||||||
|
Loading…
Reference in new issue