{"name":"js-sha1","version":"0.7.0","description":"A simple SHA1 hash function for JavaScript supports UTF-8 encoding.","main":"src/sha1.js","devDependencies":{"expect.js":"~0.3.1","mocha":"~10.2.0","nyc":"^15.1.0","requirejs":"^2.1.22","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/sha1.js -c -m eval --comments -o build/sha1.min.js"},"repository":{"type":"git","url":"git+https://github.com/emn178/js-sha1.git"},"keywords":["sha","sha1","encryption","cryptography","HMAC"],"license":"MIT","author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"homepage":"https://github.com/emn178/js-sha1","bugs":{"url":"https://github.com/emn178/js-sha1/issues"},"nyc":{"exclude":["tests"]},"browser":{"crypto":false,"buffer":false},"gitHead":"33acf62431a91405fec29f8a0318b528f5e411a9","_id":"js-sha1@0.7.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-oQZ1Mo7440BfLSv9TX87VNEyU52pXPVG19F9PL3gTgNt0tVxlZ8F4O6yze3CLuLx28TxotxvlyepCNaaV0ZjMw==","shasum":"fecaf5f36bb09a51b01da46b43a207c8452c9c1e","tarball":"http://registry-npm.ywwl.com/js-sha1/download/js-sha1-0.7.0.tgz","fileCount":7,"unpackedSize":33547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAwTpcPDkSXnNRkI1oEO8Yvs4pZi7bQTae3vTAW7pitBAiEAjd8cNuCJeod3825pTOzchBRpWztL2beAUKhUDRRza3c="}],"size":9188,"noattachment":false,"key":"/js-sha1/-/js-sha1-0.7.0.tgz"},"_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"directories":{},"maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sha1_0.7.0_1706067097006_0.8694333411085078"},"_hasShrinkwrap":false,"readme":"# js-sha1\n[![Build Status](https://travis-ci.org/emn178/js-sha1.svg?branch=master)](https://travis-ci.org/emn178/js-sha1)\n[![Coverage Status](https://coveralls.io/repos/emn178/js-sha1/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha1?branch=master)  \n[![NPM](https://nodei.co/npm/js-sha1.png?stars&downloads)](https://nodei.co/npm/js-sha1/)  \nA simple SHA1 hash function for JavaScript supports UTF-8 encoding.\n\n## Demo\n[SHA1 Online](http://emn178.github.io/online-tools/sha1.html)\n[SHA1 File Checksum Online](https://emn178.github.io/online-tools/sha1_checksum.html)\n\n## Download\n[Compress](https://raw.github.com/emn178/js-sha1/master/build/sha1.min.js)  \n[Uncompress](https://raw.github.com/emn178/js-sha1/master/src/sha1.js)\n\n## Installation\nYou can also install js-sha1 by using Bower.\n\n    bower install js-sha1\n\nFor node.js, you can use this command to install:\n\n    npm install js-sha1\n\n## Notice\nNIST formally deprecated use of SHA-1 in 2011 and disallowed its use for digital signatures in 2013, and declared that it should be phased out by 2030. However, SHA-1 is still secure for HMAC. [wiki](https://en.wikipedia.org/wiki/SHA-1)\n\n## Usage\nYou could use like this:\n```JavaScript\nsha1('Message to hash');\nvar hash = sha1.create();\nhash.update('Message to hash');\nhash.hex();\n\n// HMAC\nsha1.hmac('key', 'Message to hash');\n\nvar hash = sha1.hmac.create('key');\nhash.update('Message to hash');\nhash.hex();\n```\n\n### Node.js\nIf you use node.js, you should require the module first:\n```JavaScript\nvar sha1 = require('js-sha1');\n```\n\n### TypeScript\nIf you use TypeScript, you can import like this:\n```TypeScript\nimport { sha1 } from 'js-sha1';\n```\n\n## RequireJS\nIt supports AMD:\n```JavaScript\nrequire(['your/path/sha1.js'], function(sha1) {\n// ...\n});\n```\n\n## Example\n```JavaScript\nsha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709\nsha1('The quick brown fox jumps over the lazy dog'); // 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12\nsha1('The quick brown fox jumps over the lazy dog.'); // 408d94384216f890ff7a0c3528e8bed1e0b01621\n\n// It also supports UTF-8 encoding\nsha1('中文'); // 7be2d2d20c106eee0836c9bc2b939890a78e8fb3\n\n// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`\nsha1([]); // da39a3ee5e6b4b0d3255bfef95601890afd80709\nsha1(new Uint8Array([])); // da39a3ee5e6b4b0d3255bfef95601890afd80709\n\n// Different output\nsha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709\nsha1.hex(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709\nsha1.array(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]\nsha1.digest(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]\nsha1.arrayBuffer(''); // ArrayBuffer\n\n// HMAC\nsha1.hmac.hex('key', 'Message to hash');\nsha1.hmac.array('key', 'Message to hash');\n// ...\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-sha1  \nAuthor: Chen, Yi-Cyuan (emn178@gmail.com)\n","publish_time":1706067097189,"_cnpm_publish_time":1706067097189,"dist-tags":{"latest":"0.7.0"}}