Skip to content

Commit

Permalink
随机生成之前重新播种
Browse files Browse the repository at this point in the history
解决在闭包内无法随机的问题
  • Loading branch information
evalor authored Jul 11, 2018
1 parent 71fc898 commit 1f29ec6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/Utility/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Random
{
static function randStr($length)
{
mt_srand();
return substr(str_shuffle("abcdefghijkmnpqrstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ23456789"), 0, $length);
}

Expand All @@ -27,4 +28,4 @@ static function randNumStr($length)
}
return $password;
}
}
}

0 comments on commit 1f29ec6

Please sign in to comment.