Sorry, this introduced a new bug (PHP Fatal error: Maximum function nesting level of ‘100’ reached, aborting), so I changed this function to:
function rw_cryptx_generate_hash($string) {
$string = str_replace("&", "&", $string);
$blacklist = array(
'32', // Space
'34', // Double quote
'39', // Single quote
'60', // Less than
'62', // Greater than
'63', // Question mark
'92', // Backslash
'94', // Caret - circumflex
'96', // Grave accent
'127', // Delete
);
$crypt = '';
$ascii = 0;
for ($i = 0; $i < strlen( $string ); $i++) {
do {
$salt = mt_rand(0, 3);
$ascii = ord ( substr ( $string, $i ) ) + $salt;
if (8364 <= $ascii) {
$ascii = 128;
}
} while ( in_array($ascii, $blacklist) ); // blacklisted chars are impossible for hash! retry with new random...
$crypt .= $salt.chr($ascii);
}
return $crypt;
}
This code runs with better performance and no recursion issues.