{"id":13677906,"url":"https://github.com/mehdibo/hibp-js","last_synced_at":"2025-04-22T12:41:52.213Z","repository":{"id":57263974,"uuid":"137750133","full_name":"mehdibo/hibp-js","owner":"mehdibo","description":"Check a password in haveibeenpwned using pure JavaScript","archived":false,"fork":false,"pushed_at":"2019-02-21T14:08:39.000Z","size":10,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T01:13:26.966Z","etag":null,"topics":["haveibeenpwned","javascript-library","password-safety","password-strength"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehdibo.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}},"created_at":"2018-06-18T12:40:21.000Z","updated_at":"2023-06-30T09:39:11.000Z","dependencies_parsed_at":"2022-08-25T02:51:54.567Z","dependency_job_id":null,"html_url":"https://github.com/mehdibo/hibp-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdibo%2Fhibp-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdibo%2Fhibp-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdibo%2Fhibp-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdibo%2Fhibp-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehdibo","download_url":"https://codeload.github.com/mehdibo/hibp-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250242846,"owners_count":21398209,"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":["haveibeenpwned","javascript-library","password-safety","password-strength"],"created_at":"2024-08-02T13:00:48.400Z","updated_at":"2025-04-22T12:41:52.157Z","avatar_url":"https://github.com/mehdibo.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# hibp-js\nThis library allows you to check if a password exists in the [Have I Been Pwned](https://haveibeenpwned.com/Passwords) database\n\n## How does it work?\nThe library will first hash the password using SHA-1 and then send the first 5 characters to HIBP's server which will return a list of hashes that starts with those characters.\n\nWe then check if the hash exists in the returned list and fire an event `hibpCheck` with the result\n\n## Installation\nYou can either download the JavaScript file or use npm:\n```\nnpm i hibp-js\n```\n\n## Usage\nYou should first load the library\n```html\n\u003cscript src=\"lib/hibp.min.js\"\u003e\u003c/script\u003e\n```\n\nThen you can call the `hibpCheck('PASSWORD HERE')` function, it will fire an event `hibpCheck` with the result, check the [example](#example) for details.\n\nDon'ts:\n- Don't tell users your password is secure just because it wasn't found in hibp.\n- Don't use this over insecure HTTP (if you don't use HTTPS you simply don't care enough about your users' data)\n\n## Example\n```javascript\n// When the result is ready check if the password was found or not\ndocument.addEventListener('hibpCheck', function (e) {\n    if(e.detail){\n        alert('Found');\n    } else {\n        alert('Not Found');\n    }\n});\nhibpCheck('password123'); // Check if the password \"password123\" is in HIBP's database\n```\nFull example can be found [here](example/index.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdibo%2Fhibp-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehdibo%2Fhibp-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdibo%2Fhibp-js/lists"}