{"id":21586057,"url":"https://github.com/magiclen/node-crc","last_synced_at":"2025-04-06T18:17:49.120Z","repository":{"id":40725322,"uuid":"95182580","full_name":"magiclen/node-crc","owner":"magiclen","description":"To compute CRC values by providing the length of bits, expression, reflection, an initial value and a final xor value. It has many built-in CRC functions.","archived":false,"fork":false,"pushed_at":"2024-10-23T07:48:12.000Z","size":253,"stargazers_count":31,"open_issues_count":6,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T17:09:43.420Z","etag":null,"topics":["crc","nodejs","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/magiclen.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":"2017-06-23T04:19:05.000Z","updated_at":"2024-10-23T07:48:13.000Z","dependencies_parsed_at":"2024-06-18T17:00:30.898Z","dependency_job_id":"7adf8276-85a2-4416-bdd0-7e2201d88167","html_url":"https://github.com/magiclen/node-crc","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-crc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-crc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-crc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-crc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/node-crc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526770,"owners_count":20953143,"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":["crc","nodejs","rust"],"created_at":"2024-11-24T15:12:30.788Z","updated_at":"2025-04-06T18:17:49.084Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"CRC For Node.js\n=================================\n\n[![CI](https://github.com/magiclen/node-crc/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/node-crc/actions/workflows/ci.yml)\n\nTo compute CRC values by providing the length of bits, expression, reflection, an initial value and a final xor value. It has many built-in CRC functions.\n\nYou need to set up the Rust development environment: [rustup](https://rustup.rs/)\n\n## Usage\n\nYou can use `crc` function to compute a CRC value by providing the length of bits, expression, reflection, an initial value and a final xor value. For example, if you want to compute a CRC-24 value.\n\n```typescript\nimport { crc } from \"node-crc\";\n\nconst result = crc(0x00864cfb, 0x00000000, 24, 0x00b704ce, 0x00000000, 0x00000000, 0x00000000, false, Buffer.from(\"hello\", \"utf8\")).toString(\"hex\");\n// Arguments: low bits of expression, high bits of expression, the length of bits, low bits of the initial value, high bits of the initial value, low bits of the final xor value, high bits of the final xor value, reflection, the source data buffer\n```\n\nTo simplify the usage, there are several common versions of CRC whose computing functions are already built-in.\n\n* crc3gsm\n* crc4itu\n* crc4interlaken\n* crc5epc\n* crc5itu\n* crc5usb\n* crc6cdma2000_a\n* crc6cdma2000_b\n* crc6darc\n* crc6gsm\n* crc6itu\n* crc7\n* crc7umts\n* crc8\n* crc8cdma2000\n* crc8darc\n* crc8dvb_s2\n* crc8ebu\n* crc8icode\n* crc8itu\n* crc8maxim\n* crc8rohc\n* crc8wcdma\n* crc10\n* crc10cdma2000\n* crc10gsm\n* crc11\n* crc12\n* crc12cdma2000\n* crc12gsm\n* crc13bbc\n* crc14darc\n* crc14gsm\n* crc15can\n* crc15mpt1327\n* crc16\n* crc16ccitt_false\n* crc16aug_ccitt\n* crc16buypass\n* crc16cdma2000\n* crc16dds_110\n* crc16dect_r\n* crc16dect_x\n* crc16dnp\n* crc16en_13757\n* crc16genibus\n* crc16maxim\n* crc16mcrf4cc\n* crc16riello\n* crc16t10_dif\n* crc16teledisk\n* crc16tms13157\n* crc16usb\n* crc_a\n* crc16kermit\n* crc16modbus\n* crc16_x25\n* crc16xmodem\n* crc17can\n* crc21can\n* crc24\n* crc24ble\n* crc24flexray_a\n* crc24flexray_b\n* crc24lte_a\n* crc24lte_b\n* crc24os9\n* crc30cdma\n* crc32\n    * It also called `crc32b` in `mhash`.\n* crc32mhash\n    * `mhash` is a common library which has two weird versions of CRC32 called `crc32` and `crc32b`. `crc32` and `crc32mhash` in this module are `crc32b` and `crc32` in mhash respectively.\n* crc32bzip2\n* crc32c\n* crc32d\n* crc32mpeg2\n* crc32posix\n* crc32q\n* crc32jamcrc\n* crc32xfer\n* crc40gsm\n* crc64\n* crc64iso\n* crc64we\n* crc64jones\n\nInput data and output data are buffers.\n\nFor instance,\n\n```typescript\nimport { crc32, crc64 } from \"node-crc\";\n\nconst result = crc32(Buffer.from(\"hello\", \"utf8\")).toString(\"hex\");\nconst result2 = crc64(Buffer.from(\"world\", \"utf8\")).toString(\"hex\");\n```\n\n## TODO\n\n1. CRC class to compute large data\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fnode-crc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fnode-crc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fnode-crc/lists"}