View Single Post
Old 06-26-2004, 12:57 PM   #41
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
I found the needed snipped from a SHA1 implementation for PHP:

Use

$eax = (int)(zerofill($eax, 0x0c));

instead of

$eax = (int)(eax >> 0x0c);

and define the following function:

PHP Code:
function zeroFill($a$b)
{
    
$z hexdec(80000000);
        if (
$z $a)
        {
            
$a >>= 1;
            
$a &= (~$z);
            
$a |= 0x40000000;
            
$a >>= ($b-1);
        }
        else
        {
            
$a >>= $b;
        }
        return 
$a;

doctorow is offline   Reply With Quote