{"id":26104164,"url":"https://github.com/alexgorbatchev/node-crc","last_synced_at":"2025-03-09T21:01:43.604Z","repository":{"id":37663741,"uuid":"1145412","full_name":"alexgorbatchev/crc","owner":"alexgorbatchev","description":"Blazingly fast CRC implementations for node.js and browser","archived":false,"fork":false,"pushed_at":"2024-03-26T10:25:56.000Z","size":1009,"stargazers_count":352,"open_issues_count":6,"forks_count":72,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-09T13:23:59.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/alexgorbatchev.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":"2010-12-07T03:49:09.000Z","updated_at":"2025-03-07T01:56:09.000Z","dependencies_parsed_at":"2024-06-18T11:29:44.472Z","dependency_job_id":"54bdadfe-f34f-4987-97d5-559d44b39bbe","html_url":"https://github.com/alexgorbatchev/crc","commit_stats":{"total_commits":190,"total_committers":28,"mean_commits":6.785714285714286,"dds":"0.32105263157894737","last_synced_commit":"31fc3853e417b5fb5ec83335428805842575f699"},"previous_names":["alexgorbatchev/node-crc"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexgorbatchev%2Fcrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexgorbatchev%2Fcrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexgorbatchev%2Fcrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexgorbatchev%2Fcrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexgorbatchev","download_url":"https://codeload.github.com/alexgorbatchev/crc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242750785,"owners_count":20179257,"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":"2025-03-09T21:01:12.200Z","updated_at":"2025-03-09T21:01:43.572Z","avatar_url":"https://github.com/alexgorbatchev.png","language":"Python","readme":"# crc\n\nFunctions for calculating Cyclic Redundancy Checks (CRC) values for the Node.js and front-end.\n\n## Features\n\n- Written in TypeScript and provides typings out of the box.\n- Supports ESM and CommonJS.\n- Pure JavaScript implementation, no native dependencies.\n- Full test suite using `pycrc` as a refenrence.\n- Supports for the following CRC algorithms:\n  - CRC1 (`crc1`)\n  - CRC8 (`crc8`)\n  - CRC8 1-Wire (`crc81wire`)\n  - CRC8 DVB-S2 (`crc8dvbs2`)\n  - CRC16 (`crc16`)\n  - CRC16 CCITT (`crc16ccitt`)\n  - CRC16 Modbus (`crc16modbus`)\n  - CRC16 Kermit (`crc16kermit`)\n  - CRC16 XModem (`crc16xmodem`)\n  - CRC24 (`crc24`)\n  - CRC32 (`crc32`)\n  - CRC32 MPEG-2 (`crc32mpeg2`)\n  - CRCJAM (`crcjam`)\n\n## Installation\n\n```\nnpm install crc\n```\n\n## Usage\n\nUsing specific CRC is the recommended way to reduce bundle size:\n\n```js\nimport crc32 from 'crc/crc32';\ncrc32('hello').toString(16);\n// \"3610a686\"\n```\n\nAlternatively you can use main default export:\n\n```js\nimport crc from 'crc';\ncrc.crc32('hello').toString(16);\n// \"3610a686\"\n```\n\nIf you really wish to minimize bundle size, you can import CRC calculators directly and pass an instance of `Int8Array`:\n\n```js\nimport crc32 from 'crc/calculators/crc32';\nconst helloWorld = new Int8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]);\ncrc32(helloWorld).toString(16);\n// \"3610a686\"\n```\n\nCommonJS is supported as well without the need to unwrap `.default`:\n\n```js\nconst crc32 = require('crc/crc32');\ncrc32('hello').toString(16);\n// \"3610a686\"\n```\n\nCalculate a CRC32 of a file:\n\n```js\ncrc32(fs.readFileSync('README.md', 'utf-8')).toString(16);\n// \"127ad531\"\n```\n\nOr using a `Buffer`:\n\n```js\ncrc32(fs.readFileSync('README.md', 'utf-8')).toString(16);\n// \"127ad531\"\n```\n\nIncrementally calculate a CRC:\n\n```js\nlet value = crc32('one');\nvalue = crc32('two', value);\nvalue = crc32('three', value);\nvalue.toString(16);\n// \"9e1c092\"\n```\n\n## Tests\n\n```\nnpm test\n```\n\n## Thanks!\n\n[pycrc](http://www.tty1.net/pycrc/) library is which the source of all of the CRC tables.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Alex Gorbatchev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","funding_links":[],"categories":["data structures and algorithms"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexgorbatchev%2Fnode-crc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexgorbatchev%2Fnode-crc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexgorbatchev%2Fnode-crc/lists"}