2017 © Pedro Peláez
 

library php-crc

Calculates CRC checksums for input data

image

kittinan/php-crc

Calculates CRC checksums for input data

  • Saturday, September 2, 2017
  • by kittinan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 639 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 15 % Grown

The README.md

mermshaus/CRC

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)

Implemented algorithms

  • CRC1
  • CRC16, CRC16-CCITT, CRC16-DNP, CRC16-Modbus, CRC16-QT, CRC16-USB, CRC16-XModem, CRC16-ZModem

Usage example

<?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"

Testing

bash $ phpunit, (*2)

Credits

  • This library is mostly a port of Digest CRC for Ruby by Hal Brodigan.

The Versions

02/09 2017

dev-master

9999999-dev

Calculates CRC checksums for input data

  Sources   Download

MIT

modbus crc crc1 crc16 crc16qt crc16dnp crc16usb xmodem zmodem ccitt

02/09 2017

1.0.0

1.0.0.0

Calculates CRC checksums for input data

  Sources   Download

MIT

modbus crc crc1 crc16 crc16qt crc16dnp crc16usb xmodem zmodem ccitt