📌  相关文章
📜  react native 获取长度为 5 个字符的数字随机字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:27.760000             🧑  作者: Mango

代码示例1
function randomString(length, chars) {
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
    return result;
}
var rString = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');