dev-master
9999999-devCalculates CRC checksums for input data
MIT
modbus crc crc1 crc16 crc16qt crc16dnp crc16usb xmodem zmodem ccitt
Wallogit.com
2017 © Pedro Peláez
Calculates CRC checksums for input data
This is work in progress. I am not an expert on the topic by any means. Therefore, I have trouble finding and verifying information about common CRC algorithms. I am especially looking for reliable test vectors., (*1)
<?php
// Autoloading via Composer
require __DIR__ . '/vendor/autoload.php';
$crc16ccitt = new mermshaus\CRC\CRC16CCITT();
$crc16ccitt->update('Hello');
$crc16ccitt->update(' World!');
$checksum = $crc16ccitt->finish();
var_dump(bin2hex($checksum)); // string(4) "882a"
bash
$ phpunit, (*2)
Calculates CRC checksums for input data
MIT
modbus crc crc1 crc16 crc16qt crc16dnp crc16usb xmodem zmodem ccitt