mirror of https://github.com/tycrek/ass
parent
de1358cfc8
commit
9b80ae6ff1
@ -1,2 +1,2 @@
|
||||
import { randomBytes } from 'crypto';
|
||||
module.exports = (length: number, charset: string[]): string => [...randomBytes(length)].map((byte) => charset[Number(byte) % charset.length]).join('').slice(1).concat(charset[0]);
|
||||
export default (length: number, charset: string[]): string => [...randomBytes(length)].map((byte) => charset[Number(byte) % charset.length]).join('').slice(1).concat(charset[0]);
|
@ -1,3 +1,3 @@
|
||||
const lengthGen = require('./lengthGen');
|
||||
import lengthGen from './lengthGen';
|
||||
const zeroWidthChars = ['\u200B', '\u200C', '\u200D', '\u2060'];
|
||||
export default ({ length }: { length: number }) => lengthGen(length, zeroWidthChars);
|
||||
|
Loading…
Reference in new issue