PHP 亂數密碼產生器

Sample 1:
function randStr($len=6)
{
$chars=’ABDEFGHJKLMNPQRSTVWXYabdefghijkmnpqrstvwxy23456789#%*’;
// characters to build the password from
mt_srand((double)microtime()*1000000*getmypid());
// seed the random number generater (must be done)
$password=”;
while(strlen($password)<$len)
$password.=substr($chars,(mt_rand()%strlen($chars)),1);
return $password;
}

Sample 2:
function generatorPassword()
{
$password_len = 7;
$password = ”;

// remove o,0,1,l
$word = 16G USB隨身碟掛載在Ubuntun上 (2012-12-24)

  • Yahoo版面調整 大白天在做的事 (2015-01-26)
  • Ubuntu 1204上安裝VMware 8.0.4 workstation (2012-08-11)
  • 陳水扁前總統海外洗錢事件之我思 (2008-08-21)
  • 罪犯的死刑 是沒有必要的 有條件的廢死 柯P你在講什麼屁話 (2015-06-02)
  • 隨機美圖

    發佈留言

    發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *