{"_id":"js-crc","_rev":"8-a460279cfd77e5cbdda0f83eea1b512f","name":"js-crc","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"js-crc","version":"0.1.0","keywords":["crc","crc-16","crc-32"],"author":{"name":"emn178","email":"emn178@gmail.com"},"license":"MIT","_id":"js-crc@0.1.0","maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"homepage":"https://github.com/emn178/js-crc","bugs":{"url":"https://github.com/emn178/js-crc/issues"},"dist":{"shasum":"ae7b7eb92af3aef2a1652fff953cda53092d70a9","tarball":"https://registry.npmjs.org/js-crc/-/js-crc-0.1.0.tgz","integrity":"sha512-NhJwi6OA+COOcF6XCd9qBdIt9sKUScsjObSl+lE3Zle288PRa+Po2ks5CADF6HsYozGTIeZkksDsYU8eX80Fpw==","signatures":[{"sig":"MEUCIQD5JFO95u4dNOszJu+kntrV70U6tTZexISMYyy42LZ9qAIgLztdTwgmY50grEpJjq77KLsgGXnSQxeIOx4jYFHTEYc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/crc.js","_from":".","_shasum":"ae7b7eb92af3aef2a1652fff953cda53092d70a9","gitHead":"65381cb9585579d154cfd0cca913148721d248d7","scripts":{"test":"mocha tests/node-test.js -r jscoverage","coveralls":"mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls"},"_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"repository":{"url":"https://github.com/emn178/js-crc.git","type":"git"},"_npmVersion":"2.1.18","description":"Simple CRC checksum functions for JavaScript(CRC-16 and CRC-32).","_nodeVersion":"0.10.35","devDependencies":{"expect.js":"~0.3.1","jscoverage":"~0.5.9"},"directories":{}},"0.2.0":{"name":"js-crc","version":"0.2.0","keywords":["crc","crc-16","crc-32"],"author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"license":"MIT","_id":"js-crc@0.2.0","maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"homepage":"https://github.com/emn178/js-crc","bugs":{"url":"https://github.com/emn178/js-crc/issues"},"dist":{"shasum":"f72c5c7618176bff75cc812a1cedbde3d8eb6839","tarball":"https://registry.npmjs.org/js-crc/-/js-crc-0.2.0.tgz","integrity":"sha512-8DdCSAOACpF8WDAjyDFBC2rj8OS4HUP9mNZBDfl8jCiPCnJG+2bkuycalxwZh6heFy6PrMvoWTp47lp6gzT65A==","signatures":[{"sig":"MEUCIG4bqZfaoiApL3rrL4vTg+F4l3sGM4i+yBqgo1E9i+ZdAiEAmdNy47B65nIY0Ujt2Kb8D4FUyNO8gLpwaiH64SFDNiM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/crc.js","_from":".","_shasum":"f72c5c7618176bff75cc812a1cedbde3d8eb6839","gitHead":"d3af574848e5928137fce19208c6ac87b559c0ea","scripts":{"test":"mocha tests/node-test.js -r jscoverage","build":"uglifyjs src/crc.js --compress --mangle --comments --output build/crc.min.js","report":"mocha tests/node-test.js -r jscoverage --covout=html","coveralls":"mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls"},"_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"repository":{"url":"git+https://github.com/emn178/js-crc.git","type":"git"},"_npmVersion":"3.10.3","description":"Simple CRC checksum functions for JavaScript(CRC-16 and CRC-32).","_nodeVersion":"6.5.0","devDependencies":{"mocha":"~2.3.4","uglifyjs":"~2.4.10","expect.js":"~0.3.1","jscoverage":"~0.5.9"},"_npmOperationalInternal":{"tmp":"tmp/js-crc-0.2.0.tgz_1486540715825_0.1340816617012024","host":"packages-18-east.internal.npmjs.com"},"directories":{}},"0.3.0":{"name":"js-crc","version":"0.3.0","keywords":["crc","crc-8","crc-16","crc-24","crc-32","crc-64"],"author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"license":"MIT","_id":"js-crc@0.3.0","maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"homepage":"https://github.com/emn178/js-crc","bugs":{"url":"https://github.com/emn178/js-crc/issues"},"dist":{"shasum":"50fc882d449c805d0dc1fb0a7b6d3953085eaf84","tarball":"https://registry.npmjs.org/js-crc/-/js-crc-0.3.0.tgz","fileCount":20,"integrity":"sha512-zGWE0PF6ure5DOjBQElaGXPtGo8/14AXtbYiZbjpySlKL8wJXezkz6jptOTHSRUrXkjOR2QhSUPHxfVBbuBAmA==","signatures":[{"sig":"MEUCIAYu2jwsUIJHxD+2l5m7McQpmrjVqT+4j+boWW1Nefh7AiEAy4lU8nPc0x/yISpmQKJCICVdyn/V8ygzTfA+3uO1DCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87102},"main":"./src/crc.min.js","exports":{".":{"types":"./index.d.ts","import":"./src/crc.js","require":"./src/crc.js"},"./models":{"types":"./models.d.ts","import":"./src/models.js","require":"./src/models.js"}},"gitHead":"1b6b146115951412c9e78fc55ecd364f9835201a","scripts":{"test":"nyc mocha tests/node-test.js","build":"uglifyjs src/crc.js -c -m eval --comments -o build/crc.min.js && uglifyjs src/models.js -c -m eval --comments -o build/models.min.js","report":"nyc --reporter=html --reporter=text mocha tests/node-test.js","coveralls":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"repository":{"url":"git+https://github.com/emn178/js-crc.git","type":"git"},"_npmVersion":"6.14.13","description":"Simple CRC checksum functions for JavaScript. Supports many predefined models such as CRC-8, CRC-16, CRC-24, CRC-32, and CRC-64. It also supports custom CRC models.","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","mocha":"~10.2.0","expect.js":"~0.3.1","uglify-js":"^3.1.9","tiny-worker":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/js-crc_0.3.0_1729587848259_0.3157443538917455","host":"s3://npm-registry-packages"}},"0.3.1":{"name":"js-crc","version":"0.3.1","description":"Simple CRC checksum functions for JavaScript. Supports many predefined models such as CRC-8, CRC-16, CRC-24, CRC-32, and CRC-64. It also supports custom CRC models.","main":"./src/crc.js","exports":{".":{"require":"./src/crc.js","import":"./src/crc.js","types":"./index.d.ts"},"./models":{"require":"./src/models.js","import":"./src/models.js","types":"./models.d.ts"}},"devDependencies":{"expect.js":"~0.3.1","mocha":"~10.2.0","nyc":"^15.1.0","tiny-worker":"^2.3.0","uglify-js":"^3.1.9"},"scripts":{"test":"nyc mocha tests/node-test.js","report":"nyc --reporter=html --reporter=text mocha tests/node-test.js","coveralls":"nyc report --reporter=text-lcov | coveralls","build":"uglifyjs src/crc.js -c -m eval --comments -o build/crc.min.js && uglifyjs src/models.js -c -m eval --comments -o build/models.min.js"},"repository":{"type":"git","url":"git+https://github.com/emn178/js-crc.git"},"keywords":["crc","crc-8","crc-16","crc-24","crc-32","crc-64"],"license":"MIT","author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"homepage":"https://github.com/emn178/js-crc","bugs":{"url":"https://github.com/emn178/js-crc/issues"},"gitHead":"84c49ee37a77ad4bbf0961bb4897df0152a808b2","_id":"js-crc@0.3.1","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-UL6puQemBcJjwdU8TVVZn0iv8/42rvvqUt47PHRaMvnBv7qxeAggVbZBf188WgGuK/+dTHI/OaRSmwSipuHzEA==","shasum":"f52bb40ad370f66559dae9fa3b2c02e8b9f136cc","tarball":"https://registry.npmjs.org/js-crc/-/js-crc-0.3.1.tgz","fileCount":20,"unpackedSize":87158,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD0Js2ES8Mog7dukBMw5yXMXwg1E+TulvrTU5kqrb6aTQIgdiem8K/GlDIUZiTnKyiHMZhEF/RQOAVcW51MqiKbKjo="}]},"_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"directories":{},"maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/js-crc_0.3.1_1747277204886_0.05386093391548763"},"_hasShrinkwrap":false}},"time":{"created":"2015-03-08T07:55:04.610Z","modified":"2025-05-15T02:46:45.239Z","0.1.0":"2015-03-08T07:55:04.610Z","0.2.0":"2017-02-08T07:58:37.692Z","0.3.0":"2024-10-22T09:04:08.463Z","0.3.1":"2025-05-15T02:46:45.062Z"},"bugs":{"url":"https://github.com/emn178/js-crc/issues"},"author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"license":"MIT","homepage":"https://github.com/emn178/js-crc","keywords":["crc","crc-8","crc-16","crc-24","crc-32","crc-64"],"repository":{"type":"git","url":"git+https://github.com/emn178/js-crc.git"},"description":"Simple CRC checksum functions for JavaScript. Supports many predefined models such as CRC-8, CRC-16, CRC-24, CRC-32, and CRC-64. It also supports custom CRC models.","maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"readme":"# js-crc\n[![Build Status](https://travis-ci.org/emn178/js-crc.svg?branch=master)](https://travis-ci.org/emn178/js-crc)\n[![Coverage Status](https://coveralls.io/repos/emn178/js-crc/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-crc?branch=master)  \n[![NPM](https://nodei.co/npm/js-crc.png?stars&downloads)](https://nodei.co/npm/js-crc/)  \nSimple CRC checksum functions for JavaScript. Supports many predefined models such as CRC-8, CRC-16, CRC-24, CRC-32, and CRC-64. It also supports custom CRC models.\n\n## Download\n### Core\n[Compress](https://raw.github.com/emn178/js-crc/master/build/crc.min.js)  \n[Uncompress](https://raw.github.com/emn178/js-crc/master/src/crc.js)  \n\n### Models\n[Compress](https://raw.github.com/emn178/js-crc/master/build/models.min.js)  \n[Uncompress](https://raw.github.com/emn178/js-crc/master/src/model.js)\n\n## Installation\nYou can also install js-crc by using Bower.\n\n    bower install js-crc\n\nFor node.js, you can use this command to install:\n\n    npm install js-crc\n\n## Import\nThere are only 2 default models in `js-crc`. crc32 and crc16. More models are in `js-crc/models`. You can check all models in [this file](https://github.com/emn178/js-crc/blob/master/src/models.js). The `name` and `alias` will convert to lower snake case and export. For example, `CRC-64/ECMA-182` will convert to `crc_64_ecma_182`.\n\n### Node.js\nIf you use node.js, you should require the module first:\n```JavaScript\nvar crc32 = require('js-crc').crc32;\nvar crc16 = require('js-crc').crc16;\nvar crc_64_ecma_182 = require('js-crc/models').crc_64_ecma_182;\n```\nor\n```JavaScript\nconst { crc32, crc16 } = require('js-crc');\nconst { crc_64_ecma_182 } = require('js-crc/models');\n```\n\n### TypeScript\nIf you use TypeScript, you can import like this:\n```TypeScript\nimport { crc32, crc16 } from 'js-crc';\nimport { crc_64_ecma_182 } from 'js-crc/models';\n```\n\n### RequireJS\nIt supports AMD:\n```JavaScript\nrequire(['your/path/crc.js'], function (crc) {\n  var crc32 = crc.crc32;\n  var crc16 = crc.crc16;\n  // ...\n});\n```\n\n## Usage\n### Basic\nYou could use like this:\n```JavaScript\ncrc32('Message to check');\ncrc16('Message to check');\n\nvar crc = crc32.create();\ncrc.update('Message to check');\ncrc.hex();\n\nvar crc2 = crc32.update('Message to check');\ncrc2.update('Message2 to check');\ncrc2.array();\n```\n\n### Custom Model\nYou can create custom model:\n```JavaScript\nconst { createModel } = require('js-crc');\nvar myModel = createModel({\n  width: 16,\n  poly: 0x8005,\n  init: 0x0000,\n  refin: true,\n  refout: true,\n  xorout: 0x0000\n});\nmyModel('Message to check');\n```\n\nIf width more than 32, `poly`, `init` and `xorout` have to split into an array of 32-bit numbers. For example\n```JavaScript\ncreateModel({\n  width: 82,\n  poly: [0x0308c, 0x01110114, 0x01440411],\n  init: [0, 0, 0],\n  refin: true,\n  refout: true,\n  xorout: [0, 0, 0]\n})\n```\n\n### Example\n```JavaScript\ncrc32('The quick brown fox jumps over the lazy dog'); // 414fa339\ncrc32('The quick brown fox jumps over the lazy dog.'); // 519025e9\n\n// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` input:\ncrc32([0]); // d202ef8d\ncrc32(new Uint8Array([0])); // d202ef8d\n```\n\n## License\nThe project is released under the [MIT license](http://www.opensource.org/licenses/MIT).\n\n## Contact\nThe project's website is located at https://github.com/emn178/js-crc  \nAuthor: Chen, Yi-Cyuan (emn178@gmail.com)\n","readmeFilename":"README.md"}