Js随机生成指定长度字符串

function a(a) {
        var d,
            e,
            b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
            c = "";
        for (d = 0; a > d; d += 1)
            e = Math.random() * b.length, e = Math.floor(e), c += b.charAt(e);
        return c
    }

  

转载于:https://www.cnblogs.com/iChina/p/5217797.html

你可能感兴趣的:(Js随机生成指定长度字符串)