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.
ass/generators/zws.js

4 lines
271 B

4 years ago
const { randomBytes } = require('crypto');
const zeroWidthChars = ['\u200B', '\u200C', '\u200D', '\u2060'];
module.exports = ({ length }) => [...randomBytes(length)].map(byte => zeroWidthChars[Number(byte) % zeroWidthChars.length]).join('').slice(1) + zeroWidthChars[0];