{"_id":"@btnguyen2k/checksum","_rev":"3-2a105fab195048e3ed2b4bb411bb3db1","name":"@btnguyen2k/checksum","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@btnguyen2k/checksum","version":"0.1.0","description":"Calculate checksum for any Javascript value","type":"module","main":"./lib/index.js","module":"./src/index.js","browser":"./lib/index.umd.js","exports":{".":{"import":"./src/index.js","require":"./lib/index.js"}},"scripts":{"build":"npm run lint && npm run test:cover && babel ./src -d ./lib","lint":"eslint .","test":"jest --verbose","test:cover":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/btnguyen2k/js-checksum.git"},"keywords":["checksum"],"author":{"name":"Thanh Nguyen"},"license":"MIT","bugs":{"url":"https://github.com/btnguyen2k/js-checksum/issues"},"homepage":"https://github.com/btnguyen2k/js-checksum#readme","dependencies":{"crypto-js":"^4.1.1"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/core":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@babel/register":"^7.22.5","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^10.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^9.0.4","@semantic-release/npm":"^10.0.4","@semantic-release/release-notes-generator":"^11.0.4","babel-jest":"^29.6.1","eslint":"^8.45.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-n":"^16.0.1","eslint-plugin-promise":"^6.1.1","jest-cli":"^29.6.1","semantic-release":"^21.0.7"},"gitHead":"953ea3ca46e89b0a8dab9d3ce6c8dd53d4cc3851","_id":"@btnguyen2k/checksum@0.1.0","_nodeVersion":"18.16.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ibGqYq2HQtMwvlahuH5tl4Rlu0n5mI+18FIifJj3BXO/9au68z0u5O1vYGkN/Eekj7vs43FV+avyQkTxXbYj3g==","shasum":"83cfebd5e9a31878b0e5b9a0cd979a32c926c6ce","tarball":"https://registry.npmjs.org/@btnguyen2k/checksum/-/checksum-0.1.0.tgz","fileCount":6,"unpackedSize":13153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2HG/LwZmpY4lMc9NDS0r/ygz4OyV2Tp+M4ZoljazfjAiEAw2/GAj/A+xbFKwLdLpuhdlnpZuusDgCpw9S3WSIDHp4="}]},"_npmUser":{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"},"directories":{},"maintainers":[{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/checksum_0.1.0_1689737050783_0.22457173319930646"},"_hasShrinkwrap":false},"0.1.1":{"name":"@btnguyen2k/checksum","version":"0.1.1","description":"Calculate checksum for any Javascript value","type":"module","main":"./lib/index.js","module":"./src/index.js","browser":"./lib/index.umd.js","exports":{".":{"import":"./src/index.js","require":"./lib/index.js"}},"scripts":{"build":"npm run lint && npm run test:cover && babel ./src -d ./lib","lint":"eslint .","test":"jest --verbose","test:cover":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/btnguyen2k/js-checksum.git"},"keywords":["checksum"],"author":{"name":"Thanh Nguyen"},"license":"MIT","bugs":{"url":"https://github.com/btnguyen2k/js-checksum/issues"},"homepage":"https://github.com/btnguyen2k/js-checksum#readme","dependencies":{"crypto-js":"^4.1.1"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/core":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@babel/register":"^7.22.5","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^10.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^9.0.4","@semantic-release/npm":"^10.0.4","@semantic-release/release-notes-generator":"^11.0.4","babel-jest":"^29.6.1","eslint":"^8.45.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-n":"^16.0.1","eslint-plugin-promise":"^6.1.1","jest-cli":"^29.6.1","semantic-release":"^21.0.7"},"_id":"@btnguyen2k/checksum@0.1.1","gitHead":"1b967b5bb02bc393b36208a5a48cf79cc279db7a","_nodeVersion":"18.16.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-zpDmi6jun6/AVoPSXj2/nrg0hOUqmrcCxM+TjZPgLviGIoGvm26P0B5tfaGpcAEkXNrqNYSJJa1yf9ZsMQPU6A==","shasum":"5cc65f796b5e06dcda134260d7843339a568b34f","tarball":"https://registry.npmjs.org/@btnguyen2k/checksum/-/checksum-0.1.1.tgz","fileCount":6,"unpackedSize":15841,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH39wibUdJVejjeRTv3oEFfOe3VGl7deyf5V1fO3MMuIAiAnab5CcHsPPDVYdLN8ChCk6/o3mZMRshAjVebeHLp+MA=="}]},"_npmUser":{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"},"directories":{},"maintainers":[{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/checksum_0.1.1_1690278330952_0.03992233937359657"},"_hasShrinkwrap":false},"0.1.2":{"name":"@btnguyen2k/checksum","version":"0.1.2","description":"Calculate checksum for any Javascript value","type":"module","main":"./lib/index.js","module":"./src/index.js","browser":"./lib/index.umd.js","exports":{".":{"import":"./src/index.js","require":"./lib/index.js"}},"scripts":{"build":"npm run lint && npm run test:cover && babel ./src -d ./lib","lint":"eslint .","test":"jest --verbose","test:cover":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/btnguyen2k/js-checksum.git"},"keywords":["checksum"],"author":{"name":"Thanh Nguyen"},"license":"MIT","bugs":{"url":"https://github.com/btnguyen2k/js-checksum/issues"},"homepage":"https://github.com/btnguyen2k/js-checksum#readme","dependencies":{"crypto-js":"^4.1.1"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/core":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@babel/register":"^7.22.5","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^10.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^9.0.4","@semantic-release/npm":"^10.0.4","@semantic-release/release-notes-generator":"^11.0.4","babel-jest":"^29.6.1","eslint":"^8.45.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-n":"^16.0.1","eslint-plugin-promise":"^6.1.1","jest-cli":"^29.6.1","semantic-release":"^21.0.7"},"_id":"@btnguyen2k/checksum@0.1.2","gitHead":"3d98aad39a2ef00c3b72d92d21a7fd859c7732a3","_nodeVersion":"18.16.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-2g8rdBqFulPILwRLRZPawFuZiDeisTW1k7fZVTAsKgeh0CO15O29oNafVGmxR/Q6prjy7DTLg+B0goQIKZgGIA==","shasum":"a319555cea1d97ce8a352c64ea56102ee77ddc60","tarball":"https://registry.npmjs.org/@btnguyen2k/checksum/-/checksum-0.1.2.tgz","fileCount":6,"unpackedSize":16478,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHACdzP96+7hwQOwBRiRv480TRbNXKgpW/ZYadAwJ0kRAiEA8Uto0Eju4gh3837m3HFntN61TFNOU0paqaieik0NeoQ="}]},"_npmUser":{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"},"directories":{},"maintainers":[{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/checksum_0.1.2_1690288578130_0.8993148451192723"},"_hasShrinkwrap":false},"0.1.3":{"name":"@btnguyen2k/checksum","version":"0.1.3","description":"Calculate checksum for any Javascript value","type":"module","main":"./lib/index.js","module":"./src/index.js","browser":"./lib/index.umd.js","exports":{".":{"import":"./src/index.js","require":"./lib/index.js"}},"scripts":{"build":"npm run lint && npm run test:cover && babel ./src -d ./lib","lint":"eslint .","test":"jest --verbose","test:cover":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/btnguyen2k/js-checksum.git"},"keywords":["checksum"],"author":{"name":"Thanh Nguyen"},"license":"MIT","bugs":{"url":"https://github.com/btnguyen2k/js-checksum/issues"},"homepage":"https://github.com/btnguyen2k/js-checksum#readme","dependencies":{"crypto-js":"^4.1.1"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/core":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@babel/register":"^7.22.5","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^10.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^9.0.4","@semantic-release/npm":"^10.0.4","@semantic-release/release-notes-generator":"^11.0.4","babel-jest":"^29.6.1","eslint":"^8.45.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-n":"^16.0.1","eslint-plugin-promise":"^6.1.1","jest-cli":"^29.6.1","semantic-release":"^21.0.7"},"_id":"@btnguyen2k/checksum@0.1.3","gitHead":"66eb07b7555e5b42811dc27bd686b831e1e55240","_nodeVersion":"18.17.0","_npmVersion":"9.8.0","dist":{"integrity":"sha512-aiuxMILOuUaMhRQB1h5vXpDQUGdrCsSV79j3rjxWtEXK2gKVTAXzxf6SyVfr2qocA34oQKKJeFhTNBKhLqGyCQ==","shasum":"10b7a5cd7fef09f66591628419a69c2f9425247e","tarball":"https://registry.npmjs.org/@btnguyen2k/checksum/-/checksum-0.1.3.tgz","fileCount":6,"unpackedSize":17085,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGskNPYZ8DijLNOhysUjuyqcGjKlG0Hb6UwT7O0RoU+8AiEA7wtfoGIHlVLQs9PAKMZL9dPH7gvNExQ14klvvfgFa1U="}]},"_npmUser":{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"},"directories":{},"maintainers":[{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/checksum_0.1.3_1690357254672_0.7954706763427581"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-19T03:24:10.671Z","0.1.0":"2023-07-19T03:24:10.962Z","modified":"2023-07-26T07:40:54.987Z","0.1.1":"2023-07-25T09:45:31.115Z","0.1.2":"2023-07-25T12:36:18.262Z","0.1.3":"2023-07-26T07:40:54.836Z"},"maintainers":[{"name":"btnguyen2k","email":"btnguyen2k@gmail.com"}],"description":"Calculate checksum for any Javascript value","homepage":"https://github.com/btnguyen2k/js-checksum#readme","keywords":["checksum"],"repository":{"type":"git","url":"git+https://github.com/btnguyen2k/js-checksum.git"},"author":{"name":"Thanh Nguyen"},"bugs":{"url":"https://github.com/btnguyen2k/js-checksum/issues"},"license":"MIT","readme":"# @btnguyen2k/checksum\n\n[![npm](https://badgen.net/npm/v/@btnguyen2k/checksum)](https://www.npmjs.com/package/@btnguyen2k/checksum)\n[![Release](https://img.shields.io/github/release/btnguyen2k/js-checksum.svg?style=flat-square)](RELEASE-NOTES.md)\n[![Actions Status](https://github.com/btnguyen2k/js-checksum/actions/workflows/all-branches.yaml/badge.svg)](https://github.com/btnguyen2k/js-checksum/actions)\n[![codecov](https://codecov.io/gh/btnguyen2k/js-checksum/branch/main/graph/badge.svg)](https://codecov.io/gh/btnguyen2k/js-checksum)\n\n🔧 Configurable hash functions: `md5`, `sha1`, `sha256` and `sha512`.\n\n⭐ Supported data types:\n- [Primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)\n- Special values: `NaN`, `null`, `undefined` and `Infinity`\n- Function\n- Array\n- Object\n- [Built-in objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects):\n  - `Symbol`\n  - `Error`\n  - `Date`\n  - `RegExp`\n  - Arrays (include `IntxxxArray`, `FloatxxxArray`, `UintxxxArray`, `ArrayBuffer` and `DataView`)\n  - `Map` (`WeakMap` is not supported!)\n  - `Set` (`WeakSet` is not supported!)\n\n💫 Support nested data structure of any supported type above.\n\n**Checksum rules**\n\n👉 `checksum(null|undefined)` returns empty string (`''`).\n\n👉 numbers (int, float, bigint) have the same checksum: `checksum(1) === checksum(1.0) === checksum(1n)`.\n\n👉 order of object properties do not affect checksum: `checksum({a: 1, b: 2}) === checksum({b: 2, a: 1})`.\n\n👉 order of map entries do not affect checksum: `checksum(new Map([['a', 1], ['b', 2]])) === checksum(new Map([['b', 2], ['a', 1]]))`.\n\n👉 order of set entries do not affect checksum: `checksum(new Set([1, 2])) === checksum(new Set([2, 1]))`.\n\n👉 map and object with the same entries have the same checksum: `checksum(new Map([['a', 1], ['b', 2]])) === checksum({a: 1, b: 2})`.\n\n👉 objects of different classes with the same entries have differnt checksums: `checksum(new Map([['a', 1], ['b', 2]])) !== checksum(new (class {a = 1; b = 2})())`.\n\n## Installation\n\n**with npm**\n\n```shell\n$ npm install -S @btnguyen2k/checksum\n```\n\n## Usage\n\n```javascript\nimport {checksum} from '@btnguyen2k/checksum'\n\n// use default hash function\nconsole.log(checksum('a string'))\n\n// specify a hash function\nconsole.log(checksum([1, 'a string', true]))\n```\n\n## License\n\nMIT - see [LICENSE.md](LICENSE.md).\n","readmeFilename":"README.md"}