{"id":28555019,"url":"https://github.com/cryptocoinjs/sha256","last_synced_at":"2025-08-22T10:39:49.663Z","repository":{"id":11606403,"uuid":"14100055","full_name":"cryptocoinjs/sha256","owner":"cryptocoinjs","description":"DEPRECATED - JavaScript component to compute the SHA256 of strings or bytes.","archived":false,"fork":false,"pushed_at":"2017-01-22T12:57:32.000Z","size":18,"stargazers_count":47,"open_issues_count":4,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-10T05:34:32.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptocoinjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-04T03:50:56.000Z","updated_at":"2025-05-28T17:14:29.000Z","dependencies_parsed_at":"2022-09-11T02:00:52.317Z","dependency_job_id":null,"html_url":"https://github.com/cryptocoinjs/sha256","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cryptocoinjs/sha256","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fsha256","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fsha256/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fsha256/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fsha256/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptocoinjs","download_url":"https://codeload.github.com/cryptocoinjs/sha256/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fsha256/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261386818,"owners_count":23150875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T05:30:23.669Z","updated_at":"2025-07-04T04:31:44.182Z","avatar_url":"https://github.com/cryptocoinjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sha256\n\nJavaScript component to compute the SHA256 of strings or bytes.\n\n## DEPRECATION NOTICE\n\nThis library is deprecated. If you think it's important to maintain this library, please submit an issue and the case will be consider or the repo / ownership will be transferred to you. Viable alternatives:\n\n1. Use Browserify\n2. https://www.npmjs.com/package/sha.js (used by Browserify)\n3. https://github.com/indutny/hash.js\n\n\n## Install\n\n### Node.js/Browserify\n\n    npm install --save sha256\n\nNote: when Node.js is detected, the Node [`Crypto`](http://nodejs.org/api/crypto.html) component is used instead of re-implementing the SHA256 hash logic.\n\n\n\n## Usage\n\nThere are two methods, one for computing the hash of the input, and one for double-hashing it:\n\n```js\nsha256('hello');   // \"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824\"\nsha256.x2('hello'); // \"d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9\"\n```\n\nInput is either an array of bytes or a string. **String are always interpreted as binary data**; if you have a hex-encoded string of data to parse, first convert it to a binary string or array of bytes.\n\nOutput by default is a hexadecimal-encoded string. Other options are an array of bytes, or a binary-encoded string:\n\n```js\nsha256('hello');   // \"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824\" \u003c= Hex-encoded; default\nsha256('hello', { asBytes: true }); // [44,242,77,186,95,176,163,14,38,232,59,42,197,185,226,158,27,22,30,92,31,167,66,94,115,4,51,98,147,139,152,36] \u003c= Array of bytes\nsha256('hello', { asString: true }); // \",òMº_°£\u0026è;*Å¹â\\§B^s3b$\" \u003c= Binary-encoded string\n```\n\n## Test\n\nUnit tests are written in [Mocha](https://mochajs.org/). To run the test suite, checkout the git repository, and from within the base folder run:\n\n```sh\n$ npm install --dev\n$ npm test\n```\n\n# Credits\n\nMost of the code from CryptoJS https://code.google.com/p/crypto-js/\n\n# License\n\n(MIT License)\n\nCopyright 2013, JP Richardson  \u003cjprichardson@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocoinjs%2Fsha256","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptocoinjs%2Fsha256","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocoinjs%2Fsha256/lists"}