一行JS代码搞定随机种子生成

生成5位的 包括33-126ascii码的函数

随机函数范围公式:

Math.floor(Math.random()*(max-min+1)+min);

new Array(5).join().replace(/(.|$)/g, function(){ return String.fromCharCode(Math.floor(Math.random()* 94 + 33));})

 

posted on 2017-07-25 17:09  在这个肆意的青春岁月  阅读(1519)  评论(0编辑  收藏  举报