You're here: Snippet Directory » PHP (130)
Language:

checksum()

Language: English
Programming Language: PHP
Published by: jd10131 [not registered]
Last Update: 5/15/2006
Views: 1091


Description

Compute a SysV style checksum.

Code

1 function checksum($s) { 2 $a = unpack('C*', $s); 3 while(list($k, $v) = each($a)) $m+=$v; 4 return $m % 0xffff; 5 }

No comments avaiable

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS