{"id":18587746,"url":"https://github.com/dolegi/rapid-crc","last_synced_at":"2025-04-10T14:30:35.833Z","repository":{"id":35061146,"uuid":"200394341","full_name":"dolegi/rapid-crc","owner":"dolegi","description":"The fastest crc nodejs implementation","archived":false,"fork":false,"pushed_at":"2023-03-03T05:17:21.000Z","size":152,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T23:35:16.754Z","etag":null,"topics":["cpp","crc","crc32","node-addon-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dolegi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-08-03T15:59:58.000Z","updated_at":"2024-04-22T15:29:57.000Z","dependencies_parsed_at":"2024-10-23T08:28:18.420Z","dependency_job_id":null,"html_url":"https://github.com/dolegi/rapid-crc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Frapid-crc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Frapid-crc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Frapid-crc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Frapid-crc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolegi","download_url":"https://codeload.github.com/dolegi/rapid-crc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233946,"owners_count":21069493,"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":["cpp","crc","crc32","node-addon-api"],"created_at":"2024-11-07T00:43:35.201Z","updated_at":"2025-04-10T14:30:35.315Z","avatar_url":"https://github.com/dolegi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/dolegi/rapid-crc.svg?branch=master)](https://travis-ci.org/dolegi/rapid-crc)\n# Rapid CRC\nThe fastest crc32 and crc32c implemenations on npm\n\n### Install\n```bash\nnpm install rapid-crc\n```\n\n### Usage\n```javascript\nconst rapidCrc = require('rapid-crc')\n\nconst crc1 = rapidCrc.crc32(Buffer.from('123'))\n// -\u003e 2297840959\nconst crc2 = rapidCrc.crc32c(Buffer.from('123'))\n// -\u003e 2413851447\n```\n\n### Details\n\n### crc32 \nUses slice-by-32 (based on slice-by-8 by intel and slice-by-16 by stehpan brumme). Increasing the size of the lookup to 32 gave the best performance on my machine (2015 macbook pro, i5, 8GB), by 64 \u003e was slower. I think this is due to the amount of data being loaded per cache-line.\n\n#### crc32c (Castagnoli)\nUses [SSE4.2](https://en.wikipedia.org/wiki/SSE4#SSE4.2).\n\n### Performance\n#### crc32\n```bash\n$ node --version\nv10.16.1\n$ node performance/benchmark-crc32.js\nrapid-crc x 1,593,095 ops/sec ±0.86% (89 runs sampled)\nturbo x 608,301 ops/sec ±2.11% (86 runs sampled)\nsheetjs x 283,236 ops/sec ±0.92% (90 runs sampled)\nFastest is rapid-crc\n```\n\n#### crc32c\n```bash\n$ node --version\nv10.16.1\n$ node performance/benchmark-crc32c.js\nrapid-crc x 2,677,754 ops/sec ±0.53% (89 runs sampled)\nturbo x 617,280 ops/sec ±0.45% (86 runs sampled)\nsse4_crc32 x 2,353,431 ops/sec ±0.57% (90 runs sampled)\nFastest is rapid-crc\n```\n\n### References\n- https://github.com/madler/zlib/blob/master/crc32.c\n- https://create.stephan-brumme.com/crc32/\n- https://www.npmjs.com/package/sse4_crc32\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolegi%2Frapid-crc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolegi%2Frapid-crc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolegi%2Frapid-crc/lists"}