{"id":13629826,"url":"https://github.com/howsecureismypassword/hsimp","last_synced_at":"2025-04-17T09:36:34.775Z","repository":{"id":25850362,"uuid":"29290034","full_name":"howsecureismypassword/hsimp","owner":"howsecureismypassword","description":"How Secure is My Password for your own website","archived":true,"fork":false,"pushed_at":"2020-10-07T07:31:00.000Z","size":169,"stargazers_count":424,"open_issues_count":1,"forks_count":86,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-12T21:14:07.645Z","etag":null,"topics":["password","security","strength"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/howsecureismypassword.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-01-15T09:23:58.000Z","updated_at":"2024-07-11T18:25:10.000Z","dependencies_parsed_at":"2022-08-24T14:15:16.138Z","dependency_job_id":null,"html_url":"https://github.com/howsecureismypassword/hsimp","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howsecureismypassword%2Fhsimp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howsecureismypassword%2Fhsimp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howsecureismypassword%2Fhsimp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howsecureismypassword%2Fhsimp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howsecureismypassword","download_url":"https://codeload.github.com/howsecureismypassword/hsimp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643045,"owners_count":21138353,"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":["password","security","strength"],"created_at":"2024-08-01T22:01:20.910Z","updated_at":"2025-04-17T09:36:34.460Z","avatar_url":"https://github.com/howsecureismypassword.png","language":"HTML","funding_links":[],"categories":["HTML","Misc/Other"],"sub_categories":["Video Streaming"],"readme":"# How Secure Is My Password?\n\nNow you can use the [howsecureismypassword.net](https://howsecureismypassword.net) password strength meter on your own sites.\n\n# About\n\nRather than just saying a password is \"weak\" or \"strong\", *How Secure is My Password?* lets your users know how long it would take someone to crack their password. It also checks against the top 10,000 most common passwords as well as a number of other checks (such as repeated strings, telephone numbers, and words followed by numbers).\n\n## Other Versions\n\nThis is the vanilla JS version of the plugin. Other versions are also available:\n\n- jQuery Version: [howsecureismypassword/jquery](https://github.com/howsecureismypassword/jquery)\n- WordPress Version: [howsecureismypassword/wordpress](https://github.com/howsecureismypassword/wordpress)\n\n# Setup\n\n## Installation\n\n```shell\nbower install hsimp\n```\n\n## CSS\nCopy the `build/hsimp.css` file to your `css` directory and include it in your document `\u003chead\u003e`:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"/css/hsimp.css\"\u003e\n```\n\n## JavaScript\nCopy the `build/hsimp.min.js` file to your `js` directory and include it at the bottom of the document `\u003cbody\u003e`:\n\n```html\n\u003cscript src=\"/js/hsimp.min.js\"\u003e\u003c/script\u003e\n\u003c!-- Other scripts go here --\u003e\n```\n\nThe `hsimp.min.js` file can optionally be used with AMD and Common JS module loaders using the module name `hsimp`. If no module loader is found a global `hsimp` function will be made available.\n\n# Usage\n\nThe `hsimp` function takes two arguments: a configuration object and an HTML `\u003cinput\u003e` element\n\n```javascript\nhsimp({\n    options: {\n        calculationsPerSecond: 1e10, // 10 billion,\n        good: 31557600e3, // 1,000 years\n        ok: 31557600 // 1 year\n    },\n    outputTime: function (time, input) {\n        console.log(time, input);\n    },\n    outputChecks: function (checks, input) {\n        console.log(checks, input);\n    }\n}, document.getElementById(\"password\"));\n```\n\n## Configuration\n\nThe configuration object supports three properties:\n\n- `options`: an object of options that affect calculations\n- `outputTime`: a function that is passed the length of time it would take to crack the given password\n- `outputChecks`: a function that is passed a list of results from various checks\n\n### `options`\n\nCurrently there are three supported options:\n\n- `calculationsPerSecond`: the assumed number of calculations per second a cracker could make (default: 10e9 - 10 billion)\n- `good`: the minimum time (in seconds) that a \"good\" (green) password would take to crack (default: 31557600e6 - 1 million years)\n- `ok`: the minimum time (in seconds) that an \"ok\" (orange) password would take to crack (default: 31557600 - 1 year)\n\n### `outputTime`\n\nThe `outputTime` function is passed two variables: the time it would take to crack the password (as a human-readable string) and (optionally) the input which it refers to.\n\n```javascript\nvar renderTime = function (time, input) {\n    document.getElementById(\"password-strength\").innerHTML = time;\n}\n\nhsimp({ outputTime: renderTime }, document.getElementById(\"password\"));\n```\n\n### `outputChecks`\n\nThe `outputChecks` function is passed two variables: an array of check results and (optionally) the input which it refers to.\n\nEach check result is an object with three properties:\n\n- `name`: the check name/title\n- `message`: some explanatory text\n- `level`: the severity level (insecure, warning, notice, achievement)\n\n```javascript\n{\n    name: \"Length: Very Short\",\n    message: \"Your password is very short. The longer a password is the more secure it will be.\",\n    level: \"warning\"\n}\n```\n\n## Language\n\nYou can update the language files using the following methods each of which accepts an object:\n\n### `hsimp.setDictionary(lang)`\n\nSets the values for \"instantly\" and \"forever\". See [https://github.com/howsecureismypassword/modules-main/blob/develop/dictionary.json](https://github.com/howsecureismypassword/modules-main/blob/develop/dictionary.json)\n\n### `hsimp.setPeriodDictionary(lang)`\n\nSets up the periods (e.g. seconds, days, years, etc.). See [https://github.com/howsecureismypassword/modules-period/blob/develop/period-dictionary.json](https://github.com/howsecureismypassword/modules-period/blob/develop/period-dictionary.json)\n\n### `hsimp.setNamedNumberDictionary(lang)`\n\nSets up number names. See [https://github.com/howsecureismypassword/modules-named-number/blob/develop/named-number-dictionary.json](https://github.com/howsecureismypassword/modules-named-number/blob/develop/named-number-dictionary.json)\n\n### `hsimp.setCheckerDictionary(lang)`\n\nSets up the wording of the various checks. See [https://github.com/howsecureismypassword/modules-checker/blob/develop/checker-dictionary.json](https://github.com/howsecureismypassword/modules-checker/blob/develop/checker-dictionary.json)\n\n## Currying\n\nThe `hsimp` function supports currying. This means you can set the options once and then use the returned function to setup more than one input:\n\n```javascript\nvar attachHSIMP = hsimp({\n    // shared options here\n});\n\nattachHSIMP(document.getElementById(\"input-1\"));\nattachHSIMP(document.getElementById(\"input-2\"));\n```\n\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015, Mark Nicholas Wales / Small Hadron Collider\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowsecureismypassword%2Fhsimp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowsecureismypassword%2Fhsimp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowsecureismypassword%2Fhsimp/lists"}