getRandomStr

源码

https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/getRandomStr

说明

获取随机乱序字符串

用法

index.ts
const result1 = utilityString.getRandomStr();
const result2 = utilityString.getRandomStr([]);
const result3 = utilityString.getRandomStr(
['a', 'b', 'c', '1', '2', '3', '_', '-'],
8,
);
const result4 = utilityString.getRandomStr(
undefined,
undefined,
false,
);
const result5 = utilityString.getRandomStr(
undefined,
undefined,
true,
);
console.log(result1); // ew1Zqoe2jwHf4LZJ
console.log(result2); // GwLaMt4g5mZR57_a
console.log(result3); // _b-2c3a1
console.log(result4); // GPksguottDxpRmOA
console.log(result5); // laHHfKBLj&w19-0L