TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
One-liner password generation in PHP
2 点
作者
sgarbi
超过 12 年前
How would you improve this one-liner?<p>$password = substr(str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$'),0 , 10);
3 条评论
murrain
超过 12 年前
Collapse
$password = str_shuffle((substr(str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),0,3).substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'),0,3).substr(str_shuffle('0123456789'),0,2).substr(str_shuffle('!@#$'),0,2)));
评论 #5083691 未加载
stevekemp
超过 12 年前
I would remove "i"/"I", or 1. I would similarly remove one of zero and the letter-o.<p>These can be confusing to people, depending on fonts.
kappaloris
超过 12 年前
variable length maybe