2 function compute_salt($newstyle) {
4 $salt =
"_" . randchar(1) .
"a.." . randchar(4);
11 # return $count random characters 12 function randchar($count){
15 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
17 # 64 = length($enc) in call to rand() below 18 $str .= substr($enc,intval(rand(0,63)),1);
22 function makesaltMD5() {
23 $saltlen=8; $saltprefix=
'$1$'; $saltsuffix=
'$';
25 while($saltlen--) $salt.=chr(rand(64,126));
26 return $saltprefix.$salt.$saltsuffix;