网上看到的一段烂代码,勉强有用
function getTel(){
var n = 2,telstr = '1';
while(n<12){
if(n<3){
while(1){
var nums = Math.floor(Math.random()*10);
if(nums!==0&&nums!==1&&nums!==2&&nums!==3&&nums!==4&&nums!==6){
telstr+=nums;
break;
}
}
}else if(n>3&&n<8){
telstr+='*';
}else{
telstr+=Math.floor(Math.random()*10);
}
n++;
}
return telstr;
}
// 151****4774
标签:function,加密,号码,telstr,getTel,n3
From: https://www.cnblogs.com/hjk1124/p/17365105.html