well, if you're just trying to hash a simple captcha image, then str_replace with a simple hash database should do just fine ;).
also, by the looks of it, you've just added a string to the end of the code. although that may work, the rest of the captcha code is unencrytped and could be programmed to remove the last 5 characters of the string or to just retrieve the set number that you need to pass, then submit the return value.
PHP Code:
<?php
function simpleHash($str,$way=1)
{
// $way == 1 // hash (redundant, and it's just to prevent errors)
// $way == 2 // unhash (needs to be set as 2 after your string. if it's empty, it'll get the value of 1)
$unenc = array('0','1','2','3','4','5','6','7','8','9');
$hash = array('y','e','w','i','t','b','q','d','j','p');
if ($way == 1)
return str_replace($unenc,$hash,$str);
elseif ($way == 2)
return str_replace($hash,$unenc,$str);
}
echo simpleHash('194981842156');
// would return 'eptpjejtwebq'
echo simpleHash('eptpjejtwebq',2); // if there's no 2 at the end, it would try to rehash this string instead of unhash it.
// would return '194981842156'
?>
-xP