Skip to content

Instantly share code, notes, and snippets.

@da411d
Created December 26, 2016 21:44
Show Gist options
  • Save da411d/fa56e3862ffc8a871897ba7283ebb771 to your computer and use it in GitHub Desktop.
Save da411d/fa56e3862ffc8a871897ba7283ebb771 to your computer and use it in GitHub Desktop.
<?php
$a = "eyuioa";
$b = "qwrtpsdfghjklzxcvbnm";
$n = "0123456789";
$I = 0;
$s = "__SALT__";
function rnd($i, $a, $data = false){
$GLOBALS['I']++;
$data = $GLOBALS['s'].$GLOBALS['I'];
$t = md5($data);
$t = substr($t, 0, 10);
$t = hexdec($t)/1099511627775;
$t = $i + $t*($a - $i);
$t = round($t);
return (int)$t;
}
$p = "";
$p .= $a[ rnd(0, strlen($a)-1) ];
$p .= $b[ rnd(0, strlen($b)-1) ];
$p .= $a[ rnd(0, strlen($a)-1) ];
$p .= $b[ rnd(0, strlen($b)-1) ];
$p .= $a[ rnd(0, strlen($a)-1) ];
$p .= $b[ rnd(0, strlen($b)-1) ];
if(rnd(0, 1)){
$p .= $a[ rnd(0, strlen($a)-1) ];
}else{
$p = $b[ rnd(0, strlen($b)-1) ].$p;
}
$p.= rnd(0, 9).rnd(0, 9);
echo $p;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment