PHPackages                             zgldh/crc16-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zgldh/crc16-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zgldh/crc16-php
===============

crc16 hash methods for PHP

v1.1(5y ago)1639.6k↓37.2%5[1 PRs](https://github.com/zgldh/crc16-php/pulls)1MITPHP

Since Oct 18Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/zgldh/crc16-php)[ Packagist](https://packagist.org/packages/zgldh/crc16-php)[ RSS](/packages/zgldh-crc16-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

crc16-php
=========

[](#crc16-php)

crc16 hash methods for PHP

Usage:
------

[](#usage)

`composer require zgldh/crc16-php`

```
use Crc16\Crc16;

$rawData = '1234567890';
$result = Crc16::IBM($rawData);           // dechex($result) === 'c57a'
$result = Crc16::MAXIM($rawData);         // dechex($result) === '3a85'
$result = Crc16::USB($rawData);           // dechex($result) === '3df5'
$result = Crc16::MODBUS($rawData);        // dechex($result) === 'c20a'
$result = Crc16::CCITT($rawData);         // dechex($result) === '286b'
$result = Crc16::CCITT_FALSE($rawData);   // dechex($result) === '3218'
$result = Crc16::X25($rawData);           // dechex($result) === '4b13'
$result = Crc16::XMODEM($rawData);        // dechex($result) === 'd321'
$result = Crc16::DNP($rawData);           // dechex($result) === 'bc1b'

```

提示： `$rawData` 可以是任意二进制数据，**不要**预先转换成十六进制字符串。 `$result` 是原始整数结果，想得到16进制字符串结果请使用 `dechex` 函数进行转换。

Test
----

[](#test)

`composer run-script test`

Thanks
------

[](#thanks)

Thanks for the algorithm author of

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance41

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~540 days

Total

2

Last Release

1865d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/312404?v=4)[zgldh](/maintainers/zgldh)[@zgldh](https://github.com/zgldh)

---

Top Contributors

[![zgldh](https://avatars.githubusercontent.com/u/312404?v=4)](https://github.com/zgldh "zgldh (8 commits)")[![kshart](https://avatars.githubusercontent.com/u/6623496?v=4)](https://github.com/kshart "kshart (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zgldh-crc16-php/health.svg)

```
[![Health](https://phpackages.com/badges/zgldh-crc16-php/health.svg)](https://phpackages.com/packages/zgldh-crc16-php)
```

###  Alternatives

[symfony/polyfill-intl-icu

Symfony polyfill for intl's ICU-related data and classes

2.6k251.4M96](/packages/symfony-polyfill-intl-icu)[vivait/string-generator-bundle

Generate random strings for IDs or keys using property annotations

1759.4k](/packages/vivait-string-generator-bundle)[withinboredom/time

Converting time to units

152.7k1](/packages/withinboredom-time)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
