kittinan/php-crc
最新稳定版本:1.0.0
Composer 安装命令:
composer require kittinan/php-crc
包简介
Calculates CRC checksums for input data
README 文档
README
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.
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
$ phpunit
Credits
- This library is mostly a port of Digest CRC for Ruby by Hal Brodigan.
Links
- Digest CRC. The Ruby library on which this library is based.
- pycrc. A tool for generating C code and corresponding lookup tables for diverse CRC algorithms. Used by Digest CRC.
- CRC calculation. An online calculator to generate checksums for arbitrary polynomials and input. Recommended by pycrc.
- On-line CRC calculation and free library. Another online calculator for some CRC algorithms.
- Catalogue of parametrised CRC algorithms. Information about many different CRC algorithms.
统计信息
- 总下载量: 83.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-02