|
function return_password () {
// set password length
$pw_length = 8;
// set ASCII range for random character generation
$low_ascii_bound = 50; // "2"
$upper_ascii_bound = 122; // "z"
// Exclude special characters and some confusing alphanumerics
vue随机密码生成器特效
基于VUE + JS + element-ui制作网页版随机密码生成器工具代码。包含英文、数字、特殊符号、字符、生成长度、生成个数等选择功能。
下载
排除一些特殊字符和字母数字混淆
// o,O,0,I,1,l etc
$notuse = array (58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108,111);
while ($i
mt_srand ((double)microtime() * 1000000);
// random limits within ASCII table
$randnum = mt_rand ($low_ascii_bound, $top_ascii_bound);
if (!in_array ($randnum, $notuse)) {
$password = $password . chr($randnum);
$i++;
}
}
return $password;
}
|