{"id":24734602,"url":"https://github.com/drazail/react-hash","last_synced_at":"2026-03-12T14:16:25.690Z","repository":{"id":48092547,"uuid":"513734232","full_name":"Drazail/react-hash","owner":"Drazail","description":"React library of cryptography standards","archived":false,"fork":false,"pushed_at":"2023-02-17T07:02:55.000Z","size":760,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T08:41:27.925Z","etag":null,"topics":["cryptography","hash","react","reactjs"],"latest_commit_sha":null,"homepage":"https://drazail.github.io/react-hash-demo/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Drazail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-07-14T02:30:53.000Z","updated_at":"2022-09-03T12:35:23.000Z","dependencies_parsed_at":"2024-06-21T16:20:35.781Z","dependency_job_id":null,"html_url":"https://github.com/Drazail/react-hash","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":0.25,"last_synced_commit":"826120599f9273850e3649c59f12b5a82b145101"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Drazail/react-hash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drazail%2Freact-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drazail%2Freact-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drazail%2Freact-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drazail%2Freact-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Drazail","download_url":"https://codeload.github.com/Drazail/react-hash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drazail%2Freact-hash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002681,"owners_count":26083442,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cryptography","hash","react","reactjs"],"created_at":"2025-01-27T19:38:55.350Z","updated_at":"2025-10-10T04:30:58.422Z","avatar_url":"https://github.com/Drazail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-hash\n\n## Getting started\n\n`$ npm install react-hash --save`\n\n---\n\n## Usage\n\n### Constants\n\n```\nHashAlgorithms : Record\u003cstring, string\u003e;\n```\n\n```\nHmacAlgorithms : Record\u003cstring, string\u003e;\n```\n\n#### Example\n\n```javascript\nimport { CONSTANTS } from 'react-hash';\n\nconst hashAlgorithm = CONSTANTS.HashAlgorithms.sha256;\n\nconst hmacAlgorithm = CONSTANTS.HmacAlgorithms.HmacSHA512;\n\n```\n***\n# Cross Platform API\n\n\nif you are using something besides react, as `JSHash` and `JSHmac` are pure javaScript implementations they should work in any JS enviroment.\n***\n\n\n#### Hash Algorithm :\n\n`\"MD2\" | \"MD5\"| \"SHA-1\"| \"SHA-224\" | \"SHA-256\" | \"SHA-384\" | \"SHA-512\"| \"keccak\"`\n\n#### HMac Algorithm :\n\n`\"HmacMD5\" | \"HmacSHA1\" | \"HmacSHA224\" | \"HmacSHA256\" | \"HmacSHA384\" | \"HmacSHA512\"`\n\n#### API:\n\n```\nJSHash(message: string, algorithm: string):Promise\u003cstring\u003e;\n```\n```\nJSHmac(message: string, secret: string, algorithm: string): Promise\u003cstring\u003e;\n```\n\n#### Example :\n\n```javascript\nimport { JSHash, JSHmac, CONSTANTS } from \"react-hash\";\n\nJSHash(\"message\", CONSTANTS.HashAlgorithms.sha256)\n  .then(hash =\u003e console.log(hash))\n  .catch(e =\u003e console.log(e));\n\nJSHmac(\"message\", \"SecretKey\", CONSTANTS.HmacAlgorithms.HmacSHA256)\n  .then(hash =\u003e console.log(hash))\n  .catch(e =\u003e console.log(e));\n```\n\n- keccak implementation defaults to 512 and is not tested against all attack vectors.\n\n***\n\n# React Hooks\n\nFollowing hooks are available:\n\n```javaScript\nexport function useHash(\n  hmacAlgo?: string = \"MD5\",\n  initialMessage: ?string = \"hello World\",\n): [\n  hashed: string,\n  setMessage: (message: string) =\u003e Promise\u003cvoid\u003e,\n  setAlgo: (algo: string) =\u003e Promise\u003cvoid\u003e\n];\n```\n\n```javaScript\nexport function useHmac(\n  hmacAlgo?: string = \"HmacMD5\",\n  initialMessage: ?string = \"hello World\",\n  initialSecret: ?string = \"SecretKey\"\n): [\n  hashed: string,\n  setMessage: (message: string) =\u003e Promise\u003cvoid\u003e,\n  setAlgo: (algo: string) =\u003e Promise\u003cvoid\u003e,\n  setSecret: (secret: string) =\u003e Promise\u003cvoid\u003e\n];\n```\n## Usage\n\n```javaScript\nconst [hashedMessage, setHashAlgo, setHashMessage] = useHash();\nconst [hmac, setHmacAlgo, setHmacMessage, setHmacSecret] = useHmac();\n```\n\n`hashedMessage` and `hmac` will update after a call to one of the setters is resolved.\n\nnote that all the setter functions of these two hooks are async and will return a `promise`.\n\n\n---\n#### Credits\n\nSome modules of this package use Open Source code snippets. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.\n\n- Project: crypto-es https://github.com/entronad/crypto-es\n\n- License (MIT) https://github.com/entronad/crypto-es/blob/master/LICENSE\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrazail%2Freact-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrazail%2Freact-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrazail%2Freact-hash/lists"}