PHP code example of pburggraf / crc

1. Go to this page and download the library: Download pburggraf/crc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pburggraf / crc example snippets




// Autoloading via Composer
RC8();
var_dump(dechex($crc8->calculate('123456789'))); // string(2) "f4"

$crc16AugCcitt = new \PBurggraf\CRC\CRC16\AugCcitt();
var_dump(dechex($crc16AugCcitt->calculate('123456789'))); // string(4) "e5cc"

$crc24 = new \PBurggraf\CRC\CRC24\CRC24();
var_dump(dechex($crc24->calculate('123456789'))); // string(6) "21cf02"

$crc32 = new \PBurggraf\CRC\CRC32\CRC32();
var_dump(dechex($crc32->calculate('123456789'))); // string(8) "cbf43926"