{"author":{"name":"planttheidea"},"browser":"dist/hash-it.js","browserslist":["defaults","Explorer >= 9","Safari >= 6","Opera >= 15","iOS >= 8","Android >= 4"],"bugs":{"url":"https://github.com/planttheidea/hash-it/issues"},"description":"Hash any object based on its value","devDependencies":{"@babel/cli":"7.14.5","@babel/core":"7.14.6","@babel/plugin-proposal-class-properties":"7.14.5","@babel/preset-env":"7.14.5","@babel/preset-react":"^7.14.5","@babel/preset-typescript":"7.14.5","@rollup/plugin-babel":"5.3.0","@rollup/plugin-commonjs":"19.0.0","@rollup/plugin-node-resolve":"13.0.0","@types/jest":"26.0.23","@typescript-eslint/eslint-plugin":"4.27.0","@typescript-eslint/parser":"4.27.0","babel-eslint":"10.1.0","babel-jest":"27.0.2","babel-loader":"8.2.2","benchmark":"2.1.4","eslint":"7.29.0","eslint-friendly-formatter":"4.0.1","eslint-loader":"4.0.2","faker":"^5.5.3","hash-object":"^0.1.7","html-webpack-plugin":"5.3.1","husky":"6.0.0","jest":"27.0.4","node-object-hash":"^2.3.7","object-hash":"^2.2.0","ora":"5.4.1","prop-types":"15.7.2","react":"^17.0.2","react-dom":"^17.0.2","regenerator-runtime":"^0.13.7","rimraf":"3.0.2","rollup":"2.52.1","rollup-plugin-terser":"7.0.2","tslib":"2.3.0","typescript":"4.3.4","webpack":"5.39.1","webpack-cli":"4.7.2","webpack-dev-server":"4.0.0-beta.3"},"homepage":"https://github.com/planttheidea/hash-it#readme","keywords":["hash","hashcode","object-hash","unique"],"license":"MIT","main":"dist/hash-it.cjs.js","module":"dist/hash-it.esm.js","name":"hash-it","repository":{"type":"git","url":"git+https://github.com/planttheidea/hash-it.git"},"scripts":{"benchmark":"npm run build && node benchmarks/index.js","benchmark:compare":"npm run build && node benchmarks/compare.js","build":"NODE_ENV=production rollup -c","clean":"rimraf dist","dev":"NODE_ENV=development webpack serve --progress","lint":"NODE_ENV=test eslint src","lint:fix":"npm run lint -- --fix","prepublishOnly":"npm run typecheck && npm run lint && npm run test && npm run build","start":"npm run dev","test":"NODE_ENV=test jest","test:coverage":"npm test -- --coverage","test:watch":"npm test -- --watch","typecheck":"tsc --noEmit"},"version":"5.0.2","gitHead":"cbad14198fbef5e29e16f27f13a553b1485bb0cd","_id":"hash-it@5.0.2","_nodeVersion":"12.19.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-csU3E/a9QEmEgPPxoShVuMcFWM329IGioEPRvYVBv3r5BFrU8pCfnk3jGEVvriAcwqd+nl6KsNhPPjg8MUzkhQ==","shasum":"8cc981944964a5124f74f1065af0c0a5d182d556","tarball":"http://registry-npm.ywwl.com/hash-it/download/hash-it-5.0.2.tgz","fileCount":13,"unpackedSize":164854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg16wQCRA9TVsSAnZWagAAbT4P/ix2YFLNteMBevhyR4+y\nJXRWMhjNqPmUmPCAjzK5DK/IcP5LqbcVbzpGjkG35xVgDNWYqvpdIXjTW6fj\nh6hyNxcnMcs+uK85Nxqy/MPlpTppDqnD4srvzbHb2CfwvnPMLHlxY50lEkxL\nhvdQVlV8NtTh1bl33HFqaTO4I3Bv9iCXYtNBqpem2wLX7MUamczF8bNqQE4e\ntj7l9I3xlPgd6UAGcEY7dDArf83X3E7eUo6whexq/Tsf6qx7ZxfO41zZ3vPl\nQ9DeuSEkOSHEG1Q4lKIxNci9SUDcK4rRa7FbqXWdqN9sJCPyXjZb/bxKCNFp\nVKxKG0TmlPAG9NGWpzLVsFbS7cCRW59ul+Wf0Wfe21/GBThkfxEZyQNQvCNw\nAOno5ypDKxX27/4avjuDgR/d5DWPY/mJ0kw01SrbXsy1+gmJk30of9u2H42V\nL4ygKGtzGMSuwFW/8COw9Y2tlm3hpgjv0Ghq8ejTA9S6Out12K3xgEV5HLBm\nvy9P2x7sjaejCyatC/6k1QLTXrq/ABpHv4FPJi5KOxqsM6ncac1oxcIEEtOH\np9B2Dt5B0JQmV9DbZSgBp3NvEfCbf/CDsUxEJkVmKQbZVEmBJF0xinKSmiEA\nbXRYu9chCtDrf7gPuRbwS8g++nZyBBPAh3RPq0vYmgMRaUdcnYL/zSTfCRyr\nh3U/\r\n=HSoi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ+VAofmZp+6yzxCPrXLzjt9ivQ6WBMbn3umrv5YDJKgIgTKqEhfn2p0dpkWs3LSl3jJcWKouLA+f4B7AV1zNQk/o="}],"size":23736,"noattachment":false,"key":"/hash-it/-/hash-it-5.0.2.tgz"},"_npmUser":{"name":"planttheidea","email":"tony.quetano@planttheidea.com"},"directories":{},"maintainers":[{"name":"planttheidea","email":"tony.quetano@planttheidea.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-it_5.0.2_1624747024410_0.22437306992147565"},"_hasShrinkwrap":false,"readme":"# hash-it\n\nFast and consistent hashCode for any object type\n\n## Table of contents\n\n- [hash-it](#hash-it)\n  - [Table of contents](#table-of-contents)\n  - [Usage](#usage)\n  - [Overview](#overview)\n  - [Hash consistency](#hash-consistency)\n  - [Support](#support)\n    - [Browsers](#browsers)\n    - [Node](#node)\n  - [Development](#development)\n\n## Usage\n\n```javascript\n// ES2015\nimport hash from 'hash-it';\n\n// CommonJS\nconst hash = require('hash-it');\n\n// hash any standard object\nconsole.log(hash({ foo: 'bar' })); // 13729774857125\n\n// or a circular object\nconsole.log(hash(window)); // 3270731309314\n```\n\n## Overview\n\n`hash-it` has a simple goal: provide a fast, consistent, unique hashCode for any object type that is uniquely based on its values. This has a number of uses such as duplication prevention, equality comparisons, blockchain construction, etc.\n\n_Any object type?_\n\nYes, any object type. Primitives, ES2015 classes like `Symbol`, DOM elements (yes, you can even hash the `window` object if you want). Any object type. Here is the list of object classes that produce consistent, unique hashes based on their value:\n\n- `Arguments`\n- `Array`\n- `ArrayBuffer`\n- `AsyncFunction` (based on `toString`)\n- `AsyncGeneratorFunction` (based on `toString`)\n- `BigInt`\n- `BigInt64Array`\n- `BigUint64Array`\n- `Boolean`\n- `DataView` (based on its `buffer`)\n- `Date` (based on `getTime`)\n- `DocumentFragment` (based on `outerHTML` of all `children`)\n- `Error` (based on `stack`)\n  - Includes all sub-types (e.g., `TypeError`, `ReferenceError`, etc.)\n- `Event` (based on all properties other than `Event.timeStamp`)\n  - Includes all sub-types (e.g., `MouseEvent`, `KeyboardEvent`, etc.)\n- `Float32Array`\n- `Float64Array`\n- `Function` (based on `toString`)\n- `GeneratorFunction` (based on `toString`)\n- `Int8Array`\n- `Int16Array`\n- `Int32Array`\n- `HTMLElement` (based on `outerHTML`)\n  - Includes all sub-types (e.g., `HTMLAnchorElement`, `HTMLDivElement`, etc.)\n- `Map` (order-agnostic)\n- `Null`\n- `Number`\n- `Object` (handles circular objects, order-agnostic)\n- `Proxy`\n- `RegExp`\n- `Set` (order-agnostic)\n- `SharedArrayBuffer`\n- `String`\n- `SVGElement` (based on `outerHTML`)\n  - Includes all sub-types (e.g., `SVGRectElement`, `SVGPolygonElement`, etc.)\n- `Symbol` (based on `toString`)\n- `Uint8Array`\n- `Uint8ClampedArray`\n- `Uint16Array`\n- `Uint32Array`\n- `Undefined`\n- `Window`\n\n_Are there any exceptions?_\n\nSadly, yes, there are a few scenarios where internal values cannot be introspected for the object. In this case, the object is hashed based on its class type and reference.\n\n- `Promise`\n  - There is no way to obtain the values contained within due to its asynchronous nature\n- `Generator` (the result of calling a `GeneratorFunction`)\n  - Like `Promise`, there is no way to obtain the values contained within due to its dynamic iterable nature\n- `WeakMap` / `WeakRef` / `WeakSet`\n  - The spec explicitly forbids iteration over them, so the unique values cannot be discovered\n\n```ts\nconst promise = Promise.resolve(123);\n\nconsole.log(hash(promise)); // 16843037491939\nconsole.log(hash(promise)); // 16843037491939\nconsole.log(hash(Promise.resolve(123))); // 4622327363876\n```\n\nIf there is an object class or data type that is missing, please submit an issue.\n\n## Hash consistency\n\nWhile the hashes will be consistent when calculated within the same environment, there is no guarantee that the resulting hash will be the same across different environments due to environment-specific or browser-specific implementations of features. This is limited to extreme edge cases, such as hashing the `window` object, but should be considered if being used with persistence over different environments.\n\n## Support\n\n### Browsers\n\n- Chrome (all versions)\n- Firefox (all versions)\n- Edge (all versions)\n- Opera 15+\n- IE 9+\n- Safari 6+\n- iOS 8+\n- Android 4+\n\n### Node\n\n- 4+\n\n## Development\n\nClone the repo and dependencies via `yarn`. The npm scripts available:\n\n- `benchmark` => run benchmark of various data types\n- `benchmark:compare` => run benchmark of some data types comparing against other hashing modules\n- `build` => run rollup to build ESM, CJS, and UMD files\n- `clean` => remove files produced from `build` script\n- `dev` => run webpack dev server to run example app / playground\n- `lint` => run ESLint against all files in the `src` folder\n- `lint:fix` => run `lint` script, automatically applying fixable changes\n- `prepublishOnly` => run `typecheck`, `lint`, `test`, and `build`\n- `start` => alias for `dev` script\n- `test` => run jest test functions with `NODE_ENV=test`\n- `test:coverage` => run `test` with coverage checker\n- `test:watch` => run `test` with persistent watcher\n- `typecheck` => run `tsc` to validate internal typings\n","publish_time":1624747024529,"_cnpm_publish_time":1624747024529,"dist-tags":{"latest":"7.1.1","next":"7.0.0-rc.0"}}