Back to index

php5  5.3.10
Functions
crc32.c File Reference
#include "php.h"
#include "basic_functions.h"
#include "crc32.h"

Go to the source code of this file.

Functions

 PHP_NAMED_FUNCTION (php_if_crc32)

Function Documentation

PHP_NAMED_FUNCTION ( php_if_crc32  )

Definition at line 27 of file crc32.c.

{
       char *p;
       int len, nr;
       php_uint32 crcinit = 0;
       register php_uint32 crc;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) {
              return;
       }
       crc = crcinit^0xFFFFFFFF;

       for (len =+nr; nr--; ++p) {
              crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
       }
       RETVAL_LONG(crc^0xFFFFFFFF);
}

Here is the call graph for this function: