{"id":14984944,"url":"https://github.com/takker99/crc","last_synced_at":"2026-02-22T21:18:23.661Z","repository":{"id":254369558,"uuid":"846300988","full_name":"takker99/crc","owner":"takker99","description":"tiny tree-shakable CRC implementations for Deno/Browser","archived":false,"fork":false,"pushed_at":"2025-01-23T02:08:04.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-07T14:19:31.654Z","etag":null,"topics":["crc","crc32","deno"],"latest_commit_sha":null,"homepage":"https://jsr.io/@takker/crc","language":"TypeScript","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/takker99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-22T23:30:10.000Z","updated_at":"2025-09-01T14:37:47.000Z","dependencies_parsed_at":"2024-12-19T04:28:45.529Z","dependency_job_id":"307d0b00-420e-465f-97a7-f7d12ee40096","html_url":"https://github.com/takker99/crc","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":0.5,"last_synced_commit":"90b0ad1a6f6f8a1fd73b67cf22a0d45087b0fcad"},"previous_names":["takker99/crc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/takker99/crc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fcrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fcrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fcrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fcrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takker99","download_url":"https://codeload.github.com/takker99/crc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takker99%2Fcrc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29727344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["crc","crc32","deno"],"created_at":"2024-09-24T14:09:54.254Z","updated_at":"2026-02-22T21:18:23.649Z","avatar_url":"https://github.com/takker99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crc\n\n[![JSR](https://jsr.io/badges/@takker/crc)](https://jsr.io/@takker/crc)\n[![codecov](https://codecov.io/gh/takker99/crc/branch/main/graph/badge.svg)](https://codecov.io/gh/takker99/crc)\n[![test](https://github.com/takker99/crc/workflows/ci/badge.svg)](https://github.com/takker99/crc/actions?query=workflow%3Aci)\n\ntiny tree-shakable CRC implementations for Deno/Browser\n\n# Features\n\n- Written in TypeScript\n- Tree-shakable\n- Pure implementation, so it works in Deno and Browser\n\n## Supported CRC algorithms\n\n- **CRC-16-Modbus** (CRC-16-IBM, CRC-16-ANSI) - Polynomial: 0xA001\n  - Used by: Modbus RTU, USB, ANSI\n- **CRC-16-CCITT** - Polynomial: 0x8408\n  - Used by: X.25, V.41, HDLC, XMODEM, Bluetooth, SD\n- **CRC-32** - Polynomial: 0xEDB88320\n  - Used by: PNG, ZIP, Ethernet\n\n# Usage\n\n## CRC-16-Modbus\n\nCalculate CRC-16-Modbus (used in Modbus RTU):\n\n```ts\nimport { crc16Modbus } from \"@takker/crc\";\nimport { assertEquals } from \"@std/assert\";\n\nassertEquals(crc16Modbus(new TextEncoder().encode(\"hello\")), 0x34f6);\n```\n\n## CRC-16-IBM\n\nCalculate CRC-16-IBM (CRC-16/ARC):\n\nCRC-16-IBM uses the same polynomial as Modbus but with a different initial value\n(0x0000 vs 0xFFFF):\n\n```ts\nimport { crc16IBM } from \"@takker/crc\";\nimport { assertEquals } from \"@std/assert\";\n\nassertEquals(crc16IBM(new TextEncoder().encode(\"hello\")), 0x34d2);\n```\n\n## CRC-16-CCITT\n\nCalculate CRC-16-CCITT (used in XMODEM, Bluetooth, etc.):\n\n```ts\nimport { crc16CCITT } from \"@takker/crc\";\nimport { assertEquals } from \"@std/assert\";\n\nassertEquals(crc16CCITT(new TextEncoder().encode(\"hello\")), 0xcb42);\n```\n\n## CRC-32\n\nCalculate CRC32 of a string:\n\n```ts\nimport { crc32 } from \"@takker/crc\";\nimport { assertEquals } from \"@std/assert\";\n\nassertEquals(crc32(new TextEncoder().encode(\"hello\")), 0x3610a686);\n```\n\nYou can also calculate incrementally:\n\n```ts\nimport { crc32 } from \"@takker/crc\";\nimport { assertEquals } from \"@std/assert\";\n\nlet checksum = crc32(new TextEncoder().encode(\"he\"));\nchecksum = crc32(new TextEncoder().encode(\"ll\"), checksum);\nchecksum = crc32(new TextEncoder().encode(\"o\"), checksum);\nassertEquals(checksum, 0x3610a686);\n```\n\n# Acknowledgements\n\nThe implementation of `crc32()` is based on the\n[crc32 implementation in fflate](https://github.com/101arrowz/fflate), created\nby [@101arrowz](https://github.com/101arrowz).\n\n# License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nLicense for fflate is listed in [LICENSE-fflate](LICENSE-fflate).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakker99%2Fcrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakker99%2Fcrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakker99%2Fcrc/lists"}