{"_id":"@economia/checksum-promise","_rev":"1-3240acd00569790030b55ce7021430db","name":"@economia/checksum-promise","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"@economia/checksum-promise","version":"1.0.3","description":"Get checksum of a file in the browser using promises.","module":"src/index.js","main":"lib/checksum-promise.js","repository":{"type":"git","url":"git+https://github.com/economia/checksum-promise.git"},"bugs":{"url":"https://github.com/economia/checksum-promise/issues"},"contributors":[{"name":"Patrik Šlárka","email":"patrik.slarka@economia.cz"},{"name":"Josef Jadrný","email":"josef.jadrny@economia.cz"},{"name":"Kryštof Matějka","email":"krystof.matejka@economia.cz"}],"license":"MIT","private":false,"scripts":{"eslint":"NODE_ENV=test eslint --color src","build":"webpack -p --bail --config config/webpack.config.js","doc:html":"documentation build ./src/** -f html -o ./docs","doc:markdown":"documentation build ./src/** -f md -o ./docs.md","doc:lint":"documentation lint ./src/**","doc":"npm run doc:lint && npm run doc:markdown && npm run doc:html","preversion":"npm run eslint","version":"npm run build && npm run doc && git add .","prepublish":"npm run build"},"dependencies":{"promise-file-reader":"^1.0.0","spark-md5":"^3.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.2","babel-preset-es2015":"^6.24.1","documentation":"^5.3.5","eslint":"^4.13.1","eslint-config-standard":"^11.0.0-beta.0","eslint-plugin-import":"^2.8.0","eslint-plugin-node":"^5.2.1","eslint-plugin-promise":"^3.6.0","eslint-plugin-standard":"^3.0.1","webpack":"^3.10.0"},"homepage":"https://github.com/economia/checksum-promise#readme","directories":{"doc":"docs"},"author":{"name":"sklep@economia.cz"},"gitHead":"87959eed803c371024378886b949ca0c2960c8a7","_id":"@economia/checksum-promise@1.0.3","_nodeVersion":"10.14.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gvumXnFgtBMU1zLxybkGaJuwjUfdN7ls9jrhOXVIuQubL872NY3/BT6P8/qTUX7sxbS/7XFheNs3wTkjgHO65w==","shasum":"71602c5317a9f2b22da4efe33453908d6d283a65","tarball":"https://registry.npmjs.org/@economia/checksum-promise/-/checksum-promise-1.0.3.tgz","fileCount":35,"unpackedSize":1574948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcme75CRA9TVsSAnZWagAAq0kP/A11bkLQuNwqfl9Pvp8+\niviEf6aAMyjlYie3DpV3nkyc1SXip/PqHTuXffTzYMqLs/lAVAfiKjrJq1Zj\nX+k/pK9RIoh9EGP/7DXElKeTe7wQYZ1e9nHuw9W4GNiD5zJWJrcVDTdNnlP+\nlUZyS/xcmxsb/CjuoUJgbDyoNBaAQBZMyF3KqpEo+PsZS9y9xkI2Bzaw0mwf\nP9le4Db/DcZQmLk2JH+nU6+tIkKmo1g7ACMWl0WAjvhHvf+Pf0lKKjivFf7+\nnC/TsoGNmQrg/CL+FAWHWY2RzwfsGYkHfELBDZAHlfvtPs0MeYKIwJYhL2oi\n3RwAD22M24GKxn0zSicYUxwld5bK1roXju5tG7d0b6e3v4I//WRiww9yH7Cr\nC7e8BGmrmpXGzHjwPqSJZApCav4Nb9f76g4CKoRe39ce9GykIRit2GHtWVHs\nQLVEg4HazME2QDAfMHN/gRVstqupFrPPseQitQkHdrCauX9inC7l3KrfFQTE\nlAELirjXE3XdTK6TbCHOWuU/WAW343TzeYV5CH9et0xg7PdeIoujtjV0jX6D\n5JetP143cJzpM4dzq2PcQzHi5lKggcFYB+Z7ZPPVaoBif4YWIvB/PuCDqbrw\nJNoN9L1OK9pemJuGCAukFWFTGVhm6/oGnCqvtEXwqWHt3YmRM+5XOptWlPTB\nH5x3\r\n=1Z0f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAp6j4085JiFbPD7oj8TY8iH5D3BF8BKmJcRS6k/jKOZAiAppjvb/bBA+1N06yt48cBdp493hG8UnWrXsYRidODwYw=="}]},"maintainers":[{"name":"iteconomia","email":"npm-registry@economia.cz"}],"_npmUser":{"name":"iteconomia","email":"npm-registry@economia.cz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/checksum-promise_1.0.3_1553592056404_0.3957343125176225"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-26T09:20:56.220Z","1.0.3":"2019-03-26T09:20:56.611Z","modified":"2022-04-05T06:38:40.445Z"},"maintainers":[{"name":"iteconomia","email":"npm-registry@economia.cz"}],"description":"Get checksum of a file in the browser using promises.","homepage":"https://github.com/economia/checksum-promise#readme","repository":{"type":"git","url":"git+https://github.com/economia/checksum-promise.git"},"contributors":[{"name":"Patrik Šlárka","email":"patrik.slarka@economia.cz"},{"name":"Josef Jadrný","email":"josef.jadrny@economia.cz"},{"name":"Kryštof Matějka","email":"krystof.matejka@economia.cz"}],"author":{"name":"sklep@economia.cz"},"bugs":{"url":"https://github.com/economia/checksum-promise/issues"},"license":"MIT","readme":"# checksum-promise\nGet checksum of a file in the browser using promises.\n\n## Basic usage\n\nComplete documentation of the files can be found [here](./docs.md).\n\nFirst of all you need to include the Checksum class (either via ES6 imports or using CommonJS): \n\n### ES6\n```js\nimport Checksum from 'checksum-promise'\n```\n\n### CommonJS\n```js\nconst Checksum = require('checksum-promise')\n```\n\nThen, all you need to do is instantiate the class (optionally passing in a config object): \n\n```js\nconst checksum = new Checksum()\n```\n\nCurrently, the only option available in the config is the chunk size you want to divide your file by. \n\nOptional config format: \n\n```js\n{\n  chunkSize: 10485760\n}\n```\n\n`10485760` is the default value of the chunk size, therefore if you are ok with using this size, you don't need to supply a config whatsoever.\n\nFinally, you can call the `calculateMd5` method of the initialized object: \n\n```js\nchecksum.calculateMd5(file).then(checksum => {\n  // do whatever you need with the checksum\n}).catch(error => {\n  // in case calculating the checksum failed\n})\n```\n\nThe provided file should be retrieved from an event on a `file` input, like so:\n\n```js\nfunction onFileInputChange (event) {\n  const file = event.target.files[0]\n}\n```\n\n## Contributing\n\nIn case you want to contribute to this library, create a pull request on our [BitBucket](https://bitbucket.org/it-economia/checksum-promise), stating what you changed.\n\n","readmeFilename":"README.md"}