{"id":21726173,"url":"https://github.com/zgldh/crc16-php","last_synced_at":"2025-06-24T22:33:41.169Z","repository":{"id":53003668,"uuid":"215935634","full_name":"zgldh/crc16-php","owner":"zgldh","description":"crc16 hash for PHP","archived":false,"fork":false,"pushed_at":"2021-06-22T05:35:29.000Z","size":10,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T14:02:29.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zgldh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["zgldh"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-10-18T03:40:10.000Z","updated_at":"2024-12-27T13:03:05.000Z","dependencies_parsed_at":"2022-09-04T17:21:17.661Z","dependency_job_id":null,"html_url":"https://github.com/zgldh/crc16-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zgldh/crc16-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgldh%2Fcrc16-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgldh%2Fcrc16-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgldh%2Fcrc16-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgldh%2Fcrc16-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zgldh","download_url":"https://codeload.github.com/zgldh/crc16-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgldh%2Fcrc16-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260878521,"owners_count":23075970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T03:22:19.846Z","updated_at":"2025-06-24T22:33:41.138Z","avatar_url":"https://github.com/zgldh.png","language":"PHP","funding_links":["https://github.com/sponsors/zgldh"],"categories":[],"sub_categories":[],"readme":"# crc16-php\ncrc16 hash methods for PHP\n\n## Usage:\n`composer require zgldh/crc16-php`\n\n```\nuse Crc16\\Crc16;\n\n$rawData = '1234567890'; \n$result = Crc16::IBM($rawData);           // dechex($result) === 'c57a'\n$result = Crc16::MAXIM($rawData);         // dechex($result) === '3a85'\n$result = Crc16::USB($rawData);           // dechex($result) === '3df5'\n$result = Crc16::MODBUS($rawData);        // dechex($result) === 'c20a'\n$result = Crc16::CCITT($rawData);         // dechex($result) === '286b'\n$result = Crc16::CCITT_FALSE($rawData);   // dechex($result) === '3218'\n$result = Crc16::X25($rawData);           // dechex($result) === '4b13'\n$result = Crc16::XMODEM($rawData);        // dechex($result) === 'd321'\n$result = Crc16::DNP($rawData);           // dechex($result) === 'bc1b'\n```\n\n提示： `$rawData` 可以是任意二进制数据，**不要**预先转换成十六进制字符串。\n`$result` 是原始整数结果，想得到16进制字符串结果请使用 `dechex` 函数进行转换。  \n## Test\n`composer run-script test`\n\n## Thanks\nThanks for the algorithm author of https://blog.csdn.net/zhang197093/article/details/89061957\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgldh%2Fcrc16-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzgldh%2Fcrc16-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgldh%2Fcrc16-php/lists"}