{"_id":"js-sha256@1.0.0","bugs":{"url":"https://github.com/emn178/js-sha256/issues"},"dist":{"shasum":"24cdfe8c9184426d814da8e16ba0c769dc425416","tarball":"http://registry-npm.ywwl.com/js-sha256/download/js-sha256-1.0.0.tgz","fileCount":21,"integrity":"sha512-Bqxf6ENUzYIMzuELCmRNrJOVbjKH1oMgbfYJBKVr/W1Xf9fazpahqCbb24v1pR7XV1isuqhM+w9KWpK7zCyUQw==","signatures":[{"sig":"MEQCIFOJyTY5iJzvYmK1r6LACaJwCf4IIykUYSyLo4kE5KK8AiBHJvgO280aWyrlgUJeA1GgWrR4qsneMpEdX9k5qEYRFA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCs4a0UVWOKki3f9oWjWDCiwR7nDK72cGyKyy6MTNBFSwIhAJ19om/QOvINt9D7x5KTiUFAqxhqRRvt+joNoFCd7ie7"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/js-sha256@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":87517,"size":22257,"noattachment":false,"key":"/js-sha256/-/js-sha256-1.0.0.tgz"},"main":"build/sha256.node.cjs","name":"js-sha256","types":"./index.d.ts","author":{"name":"Chen, Yi-Cyuan","email":"emn178@gmail.com"},"module":"src/index.mjs","browser":"build/sha256.cjs","exports":{".":{"node":{"import":"./src/node.mjs","require":"./build/sha256.node.cjs"},"types":"./index.d.ts","import":"./src/index.mjs","default":"./src/index.mjs","require":"./build/sha256.cjs"},"./package.json":"./package.json","./src/sha256.js":"./build/sha256.js","./build/sha256.js":"./build/sha256.js","./build/sha256.cjs":"./build/sha256.cjs","./build/sha256.min.js":"./build/sha256.min.js","./build/sha256.min.mjs":"./build/sha256.min.mjs","./build/sha256.node.cjs":"./build/sha256.node.cjs"},"gitHead":"9a54fb31d4594762987e1b5d175265f6bac921de","license":"MIT","scripts":{"test":"npm run build && npm run test:coverage","build":"rollup -c","prepack":"npm run build","test:dist":"node tests/dist-test.mjs","test:unit":"mocha tests/core-test.mjs && mocha tests/node-test.mjs","test:browser":"playwright test","test:runtime":"npm run test:unit && npm run test:dist","test:coverage":"c8 --all --include=src/shared.mjs --include=src/core.mjs --include=src/node.mjs --reporter=text --reporter=html --reporter=lcov npm run test:runtime"},"version":"1.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ac4cd447-22f9-4e4f-9124-74e82f542951"}},"homepage":"https://github.com/emn178/js-sha256","keywords":["sha","sha2","sha224","sha256","hash","encryption","cryptography","HMAC"],"repository":{"url":"git+https://github.com/emn178/js-sha256.git","type":"git"},"_npmVersion":"11.16.0","description":"A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.","directories":{},"maintainers":[{"name":"emn178","email":"emn178@gmail.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","mocha":"~10.8.2","rollup":"^4.43.0","@playwright/test":"^1.62.0","@rollup/plugin-terser":"^1.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/js-sha256_1.0.0_1785135653081_0.5092144981813524"},"readme":"# js-sha256\n[![CI](https://github.com/emn178/js-sha256/actions/workflows/ci.yml/badge.svg)](https://github.com/emn178/js-sha256/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/emn178/js-sha256/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha256?branch=master)\n[![NPM](https://img.shields.io/npm/v/js-sha256)](https://www.npmjs.com/package/js-sha256)\n[![CDNJS](https://img.shields.io/jsdelivr/npm/hm/js-sha256)](https://www.jsdelivr.com/package/npm/js-sha256)\n\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[SHA224 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/build/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\n\n### Browser\nLoad the minified UMD build to expose `sha256` and `sha224` as globals:\n\n```HTML\n<script src=\"sha256.min.js\"></script>\n<script>\n  console.log(sha256('Message to hash'));\n</script>\n```\n\n### ES Modules\n```JavaScript\nimport { sha256, sha224 } from 'js-sha256';\n```\n\n### CommonJS\n```JavaScript\nconst { sha256, sha224 } = require('js-sha256');\n```\n\n### API\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\nNode.js automatically uses its native `crypto` implementation with the same API:\n\n```JavaScript\nimport { sha256, sha224 } from 'js-sha256';\n\nconst hash = sha256.create();\nhash.update('Message');\nhash.update(' to hash');\nconsole.log(hash.hex());\n```\n\n### TypeScript\nIf you use TypeScript, you can import like this:\n```TypeScript\nimport { sha256, sha224 } from 'js-sha256';\n```\n### RequireJS\nThe UMD browser build supports AMD:\n```JavaScript\nrequire(['your/path/sha256.min.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":1785135653179,"_cnpm_publish_time":1785135653179,"dist-tags":{"latest":"1.1.0"}}