This is a strange request but here you go.

function CRC8bit($data){
        return (crc32($data) & 255);
}

-----Original Message-----
From: Brian C. Doyle [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 16, 2002 11:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 8 bit check sum???? Not 32 bit


Hello all,

I currently have a perl subroutine that uses an 8 bit check sum.  From
what I have found, in books and the site, php will only do 32 bit.

Here is what I have currently

sub _hash_domain {
        return uc(
                unpack('H2',
                        pack('C',
                                unpack("%8C*", shift)
                        )       
                )
        );
}

This works fine in perl but I would like to get this to work in PHP What
am I missing.

Thanks for you help

Brian C. Doyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to