{"id":13808886,"url":"https://github.com/dchest/fast-sha256-js","last_synced_at":"2025-04-04T20:10:11.229Z","repository":{"id":18537726,"uuid":"21738542","full_name":"dchest/fast-sha256-js","owner":"dchest","description":"SHA-256, HMAC, HKDF and PBKDF2 implementation for JavaScript/TypeScript with typed arrays for modern browsers and Node.js","archived":false,"fork":false,"pushed_at":"2023-07-12T03:24:11.000Z","size":1640,"stargazers_count":133,"open_issues_count":3,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-14T12:07:59.267Z","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":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dchest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-11T14:13:09.000Z","updated_at":"2024-08-31T03:37:13.000Z","dependencies_parsed_at":"2024-06-20T23:27:15.720Z","dependency_job_id":"2ab999e2-b00c-40d8-a72f-927780b93e8a","html_url":"https://github.com/dchest/fast-sha256-js","commit_stats":{"total_commits":67,"total_committers":3,"mean_commits":"22.333333333333332","dds":"0.10447761194029848","last_synced_commit":"3aef11eb8222f819dc255996d86ba976f205dca2"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Ffast-sha256-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Ffast-sha256-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Ffast-sha256-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Ffast-sha256-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchest","download_url":"https://codeload.github.com/dchest/fast-sha256-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":"2024-08-04T01:01:54.232Z","updated_at":"2025-04-04T20:10:11.203Z","avatar_url":"https://github.com/dchest.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"fast-sha256-js\n==============\n\nSHA-256 implementation for JavaScript/TypeScript with typed arrays\nthat works in modern browsers and Node.js.\nImplements the hash function, HMAC, and PBKDF2.\n\nPublic domain. No warranty.\n\n[![Build Status](https://travis-ci.org/dchest/fast-sha256-js.svg?branch=master)\n](https://travis-ci.org/dchest/fast-sha256-js)\n\n\nInstallation\n------------\n\nYou can install fast-sha256-js via [NPM](https://www.npmjs.org/):\n\n    $ npm install fast-sha256\n\nor [download source code](https://github.com/dchest/fast-sha256-js/releases).\n\n\nUsage\n-----\n\nFunctions accept and return `Uint8Array`s.\nTo convert strings, use external library (for example,\n[nacl.util](https://github.com/dchest/tweetnacl-util-js/)).\n\n### sha256(message)\n\nReturns a SHA-256 hash of the message.\n\n\n### sha256.hmac(key, message)\n\nReturns an HMAC-SHA-256 of the message for the key.\n\n\n### sha256.pbkdf2(password, salt, rounds, dkLen)\n\nReturns a key of length dkLen derived using PBKDF2-HMAC-SHA256\nfrom the given password, salt, and the number of rounds.\n\n\n### sha256.hkdf(key, salt, info?, length?)\n\nReturns a key of the given length derived using HKDF as\ndescribed in RFC 5869.\n\nThere are also classes `Hash` and `HMAC`:\n\n### new sha256.Hash()\n\nConstructor for hash instance. Should be used with `new`.\nAvailable methods: `update()`, `digest()`, `reset()`, etc.\n\n### new sha256.HMAC(key)\n\nConstructor for HMAC instance. Should be used with `new`.\nAvailable methods: `update()`, `digest()`, `reset()`, etc.\n\nSee comments in `src/sha256.ts` for details.\n\n\nUsage with TypeScript\n---------------------\n\n```typescript\nimport sha256, { Hash, HMAC } from \"fast-sha256\";\n\nsha256(data) // default export is hash\n\nconst h = new HMAC(key); // also Hash and HMAC classes\nconst mac = h.update(data).digest();\n\n// alternatively:\n\nimport * as sha256 from \"fast-sha256\";\n\nsha256.pbkdf2(password, salt, iterations, dkLen); // returns derived key\nsha256.hash(data)\n\nconst hasher = new sha256.Hash();\nhasher.update(data1);\nhasher.update(data2);\nconst result = hasher.digest();\n```\n\n\nTesting and building\n--------------------\n\nInstall development dependencies:\n\n    $ npm install\n\nBuild JavaScript, minified version, and typings:\n\n    $ npm run build\n\nRun tests:\n\n    $ npm test\n\nRun tests on a different source file:\n\n    $ SHA256_SRC=sha256.min.js npm test\n\nRun benchmark:\n\n    $ npm run bench\n\n(or in a browser, open `tests/bench.html`).\n\nLint:\n\n    $ npm run lint\n\n\nNotes\n-----\n\nWhile this implementation is pretty fast compared to previous generation\nimplementations, if you need an even faster one, check out\n[asmCrypto](https://github.com/vibornoff/asmcrypto.js).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Ffast-sha256-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchest%2Ffast-sha256-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Ffast-sha256-js/lists"}