{"name":"js-sha256","version":"0.7.1","description":"A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.","main":"src/sha256.js","devDependencies":{"expect.js":"~0.3.1","jscoverage":"~0.5.9","mocha":"~2.3.4","uglifyjs":"~2.4.10"},"scripts":{"test":"mocha tests/node-test.js -r jscoverage","report":"mocha tests/node-test.js -r jscoverage --covout=html","coveralls":"mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls","build":"uglifyjs src/sha256.js --compress --mangle --comments --output build/sha256.min.js"},"repository":{"type":"git","url":"git+https://github.com/emn178/js-sha256.git"},"keywords":["sha","sha2","sha224","sha256","hash","encryption","cryptography","HMAC"],"license":"MIT","author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"homepage":"https://github.com/emn178/js-sha256","bugs":{"url":"https://github.com/emn178/js-sha256/issues"},"gitHead":"cf975dfa0cc560c443347ae42ceeabf3e28dfe8a","_id":"js-sha256@0.7.1","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"emn178","email":"emn178@gmail.com"},"dist":{"integrity":"sha512-h8ClGdLqWo3y1PTmcd9aVExTbQouLVLsVigxYSN+rsmlCEX0TlQ0Xkbu4r2OIF+U29e7k1O0NxhtRRd0sJgAjg==","shasum":"929c4244ecf19d535404c338b19ab693f5cf4b1b","tarball":"http://registry-npm.ywwl.com/js-sha256/download/js-sha256-0.7.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH6myAxr5Wk7F5luNOlQ0Eb3s+hdySqj/ebrCd0emfEwAiEA+toT7DuQq7BqXT8t2Vuk8Wjwdlx2IEzVISmhJx8D6eo="}],"size":16118,"noattachment":false,"key":"/js-sha256/-/js-sha256-0.7.1.tgz"},"maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sha256-0.7.1.tgz_1509453320577_0.38534176256507635"},"directories":{},"readme":"# js-sha256\n[![Build Status](https://travis-ci.org/emn178/js-sha256.svg?branch=master)](https://travis-ci.org/emn178/js-sha256)\n[![Coverage Status](https://coveralls.io/repos/emn178/js-sha256/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha256?branch=master)\n[![CDNJS](https://img.shields.io/cdnjs/v/js-sha256.svg)](https://cdnjs.com/libraries/js-sha256/)  \n[![NPM](https://nodei.co/npm/js-sha256.png?stars&downloads)](https://nodei.co/npm/js-sha256/)  \nA simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.\n\n## Demo\n[SHA256 Online](https://emn178.github.io/online-tools/sha256.html)  \n[SHA224 Online](https://emn178.github.io/online-tools/sha224.html)  \n[SHA256 File Online](https://emn178.github.io/online-tools/sha256_checksum.html)  \n[SHA225 File Online](https://emn178.github.io/online-tools/sha224_checksum.html)  \n\n## Download\n[Compress](https://raw.github.com/emn178/js-sha256/master/build/sha256.min.js)  \n[Uncompress](https://raw.github.com/emn178/js-sha256/master/src/sha256.js)\n\n## Installation\nYou can also install js-sha256 by using Bower.\n\n    bower install js-sha256\n\nFor node.js, you can use this command to install:\n\n    npm install js-sha256\n\n## Usage\nYou could use like this:\n```JavaScript\nsha256('Message to hash');\nsha224('Message to hash');\n\nvar hash = sha256.create();\nhash.update('Message to hash');\nhash.hex();\n\nvar hash2 = sha256.update('Message to hash');\nhash2.update('Message2 to hash');\nhash2.array();\n\n// HMAC\nsha256.hmac('key', 'Message to hash');\nsha224.hmac('key', 'Message to hash');\n\nvar hash = sha256.hmac.create('key');\nhash.update('Message to hash');\nhash.hex();\n\nvar hash2 = sha256.hmac.update('key', 'Message to hash');\nhash2.update('Message2 to hash');\nhash2.array();\n```\n\n### Node.js\nIf you use node.js, you should require the module first:\n```JavaScript\nvar sha256 = require('js-sha256');\n```\nor\n```JavaScript\nvar sha256 = require('js-sha256').sha256;\nvar sha224 = require('js-sha256').sha224;\n```\nor\n```JavaScript\nconst { sha256, sha224 } = require('js-sha256');\n```\n### TypeScript\nIf you use TypeScript, you can import like this:\n```TypeScript\nimport { sha256, sha224 } from 'js-sha256';\n```\n### RequireJS\nIt supports AMD:\n```JavaScript\nrequire(['your/path/sha256.js'], function(sha256) {\n// ...\n});\n```\n## Example\n```JavaScript\nsha256(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nsha256('The quick brown fox jumps over the lazy dog'); // d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592\nsha256('The quick brown fox jumps over the lazy dog.'); // ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c\nsha224(''); // d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f\nsha224('The quick brown fox jumps over the lazy dog'); // 730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525\nsha224('The quick brown fox jumps over the lazy dog.'); // 619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c\n\n// It also supports UTF-8 encoding\nsha256('中文'); // 72726d8818f693066ceb69afa364218b692e62ea92b385782363780f47529c21\nsha224('中文'); // dfbab71afdf54388af4d55f8bd3de8c9b15e0eb916bf9125f4a959d4\n\n// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` input\nsha256([]); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nsha256(new Uint8Array([211, 212])); // 182889f925ae4e5cc37118ded6ed87f7bdc7cab5ec5e78faef2e50048999473f\n\n// Different output\nsha256(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nsha256.hex(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nsha256.array(''); // [227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85]\nsha256.digest(''); // [227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85]\nsha256.arrayBuffer(''); // ArrayBuffer\n```\n\n## Benchmark\n[jsPerf Benchmark](https://jsperf.app/cidole/2)\n\n## License\nThe project is released under the [MIT license](https://opensource.org/license/mit/).\n\n## Contact\nThe project's website is located at https://github.com/emn178/js-sha256  \nAuthor: Chen, Yi-Cyuan (emn178@gmail.com)\n","publish_time":1509453320711,"_cnpm_publish_time":1509453320711,"dist-tags":{"latest":"1.1.0"}}