{"id":18527365,"url":"https://github.com/formigarafa/zxcvbn-rb","last_synced_at":"2025-04-05T04:12:49.802Z","repository":{"id":45145990,"uuid":"367633700","full_name":"formigarafa/zxcvbn-rb","owner":"formigarafa","description":"Low-Budget Password Strength Estimation written in Ruby","archived":false,"fork":false,"pushed_at":"2025-01-04T02:13:06.000Z","size":1327,"stargazers_count":34,"open_issues_count":4,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:09:12.126Z","etag":null,"topics":["password-strength","password-validator","ruby","zxcvbn","zxcvbn-ruby","zxcvbn-sandbox"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/formigarafa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-05-15T13:05:09.000Z","updated_at":"2025-02-05T13:47:29.000Z","dependencies_parsed_at":"2025-01-05T02:08:14.599Z","dependency_job_id":"06556e04-3838-44e7-9106-b00a7075499f","html_url":"https://github.com/formigarafa/zxcvbn-rb","commit_stats":{"total_commits":82,"total_committers":1,"mean_commits":82.0,"dds":0.0,"last_synced_commit":"024828e89f89b2a103f43203e3dd768a0d10ac79"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formigarafa%2Fzxcvbn-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formigarafa%2Fzxcvbn-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formigarafa%2Fzxcvbn-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formigarafa%2Fzxcvbn-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formigarafa","download_url":"https://codeload.github.com/formigarafa/zxcvbn-rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"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-strength","password-validator","ruby","zxcvbn","zxcvbn-ruby","zxcvbn-sandbox"],"created_at":"2024-11-06T17:54:57.928Z","updated_at":"2025-04-05T04:12:49.781Z","avatar_url":"https://github.com/formigarafa.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zxcvbn\n\n[![Gem Version](https://badge.fury.io/rb/zxcvbn.svg)](https://badge.fury.io/rb/zxcvbn)\n[![Build Status](https://github.com/formigarafa/zxcvbn-rb/actions/workflows/tests.yml/badge.svg)](https://github.com/formigarafa/zxcvbn-rb)\n\nRuby port of Dropbox's [zxcvbn.js](https://github.com/dropbox/zxcvbn) JavaScript library running completely in Ruby (no need to load execjs or libv8).\n\n### Goals:\n- Exact same results as [dropbox/zxcvbn.js (Version 4.4.2)](https://github.com/dropbox/zxcvbn). If **result compatibility** is found or made different a major version will be bumped so no one is caught off guard.\n- Parity of features to [dropbox/zxcvbn.js (Version 4.4.2)](https://github.com/dropbox/zxcvbn) interface.\n- 100% native Ruby solution: **No Javascript Runtime**.\n\n### Compatible with [zxcvbn-js](https://github.com/bitzesty/zxcvbn-js) and [zxcvbn-ruby](https://github.com/envato/zxcvbn-ruby)\n\nThis gem include compatibility interfaces so it can be used as a drop-in substitution both of the most popular alternatives `zxcvbn-js` and `zxcvbn-ruby`). Besides `Zxcvbn.zxcvbn` you can just call `Zxcvbn.test` or use `Zxcvbn::Tester.new` the same way as you would if you were using any of them.\n\n|                                    | `zxcvbn-rb`            | `zxcvbn-js`            | `zxcvbn-ruby`          |\n|------------------------------------|------------------------|------------------------|------------------------|\n| Results match `zxcvbn.js (V4.4.2)` | :white_check_mark: yes | :white_check_mark: yes | :x: no                 |\n| Run without Javascript Runtime     | :white_check_mark: yes | :x: no                 | :white_check_mark: yes |\n| Interface compatibility with others| :white_check_mark: yes | :x: no                 | :x: no                 |\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'zxcvbn'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install zxcvbn\n\n## Usage\n\n```ruby\nZxcvbn.zxcvbn(\"password\")\n=\u003e {\n  \"password\" =\u003e \"password\",\n  \"guesses\" =\u003e 3,\n  \"guesses_log10\" =\u003e 0.47712125471966244,\n  \"sequence\" =\u003e [\n    {\n      \"pattern\" =\u003e \"dictionary\",\n      \"i\" =\u003e 0,\n      \"j\" =\u003e 7,\n      \"token\" =\u003e \"password\",\n      \"matched_word\" =\u003e \"password\",\n      \"rank\" =\u003e 2,\n      \"dictionary_name\" =\u003e \"passwords\",\n      \"reversed\" =\u003e false,\n      \"l33t\" =\u003e false,\n      \"base_guesses\" =\u003e 2,\n      \"uppercase_variations\" =\u003e 1,\n      \"l33t_variations\" =\u003e 1,\n      \"guesses\" =\u003e 2,\n      \"guesses_log10\" =\u003e 0.3010299956639812\n    }\n  ],\n  \"calc_time\" =\u003e 1,\n  \"crack_times_seconds\" =\u003e {\n    \"online_throttling_100_per_hour\" =\u003e 108.0,\n    \"online_no_throttling_10_per_second\" =\u003e 0.3,\n    \"offline_slow_hashing_1e4_per_second\" =\u003e 0.0003,\n    \"offline_fast_hashing_1e10_per_second\" =\u003e 3.0e-10},\n  \"crack_times_display\" =\u003e {\n    \"online_throttling_100_per_hour\" =\u003e \"2 minutes\",\n    \"online_no_throttling_10_per_second\" =\u003e \"less than a second\",\n    \"offline_slow_hashing_1e4_per_second\" =\u003e \"less than a second\",\n    \"offline_fast_hashing_1e10_per_second\" =\u003e \"less than a second\"\n  },\n  \"score\" =\u003e 0,\n  \"feedback\" =\u003e {\n    \"warning\" =\u003e \"This is a top-10 common password\",\n    \"suggestions\" =\u003e [\n      \"Add another word or two. Uncommon words are better.\"\n    ]\n  }\n}\n```\n\n## Testing Multiple Passwords\n\nThe dictionaries used for password strength testing are loaded each request to `Zxcvbn.zxcvbn`. If you you'd prefer to persist the dictionaries in memory (approx 7.2MB RSS) to perform lots of password tests in succession then you can use the `Zxcvbn::Tester` API:\n\n```ruby\ntester = Zxcvbn::Tester.new\n=\u003e #\u003cZxcvbn::Tester:0x0000000102498678\u003e\n\ntester.zxcvbn('@lfred2004', ['alfred'])\n=\u003e {\"password\"=\u003e\"@lfred2004\", \"guesses\"=\u003e15000, \"guesses_log10\"=\u003e4.176091259055681, \"sequence\"=\u003e[{\"pattern\"=\u003e\"dictionary\", ... \"feedback\"=\u003e{\"warning\"=\u003e\"\", \"suggestions\"=\u003e[\"Add another word or two. Uncommon words are better.\", \"Predictable substitutions like '@' instead of 'a' don't help very much\"]}}\n\n\u003e\u003e tester.zxcvbn('j0hn2025', ['john'])\n=\u003e {\"password\"=\u003e\"j0hn2025\", \"guesses\"=\u003e225333.3333333333, \"guesses_log10\"=\u003e5.352825441221974, \"sequence\"=\u003e[{\"pattern\"=\u003e\"dictionary\", ... \"feedback\"=\u003e{\"warning\"=\u003e\"Common names and surnames are easy to guess\", \"suggestions\"=\u003e[\"Add another word or two. Uncommon words are better.\", \"Predictable substitutions like '@' instead of 'a' don't help very much\"]}}\n```\n\n### Note about translations (i18n, gettext, etc...)\nCheck the [wiki](https://github.com/formigarafa/zxcvbn-rb/wiki) for more details on how to handle translations.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/formigarafa/zxcvbn-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/formigarafa/zxcvbn-rb/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Zxcvbn project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/formigarafa/zxcvbn-rb/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformigarafa%2Fzxcvbn-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformigarafa%2Fzxcvbn-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformigarafa%2Fzxcvbn-rb/lists"}