zxcvbn 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 60e3fe0e3604968ba838150d7334d871d91a14bad10aa8c1a4050545cda8492c
4
+ data.tar.gz: 8c5836256bc2d4a09ebd270d0197e7f59188b154e530e6d9c06054e1f4257cce
5
+ SHA512:
6
+ metadata.gz: a867966270f4d47b229c7be339d545e332c612fde4498ab1033ca21fa95d470938f11740109d7c6ec289dead9dc87f72eb1ad1d9d33f844ae16d9594b4de3df1
7
+ data.tar.gz: d8788fbe1532f2ae838a4329d04ee3ba779cc8369f082b6f3aa2b4eb0f5b678c05e55f19ee254f26418da99e399821950ea814c6ba352f8ce2d69e1f1654ec4f
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.6
6
+ before_install: gem install bundler -v 2.2.15
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-05-16
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at formigarafa@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in zxcvbn.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ zxcvbn (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.4.4)
11
+ parallel (1.20.1)
12
+ parser (3.0.1.1)
13
+ ast (~> 2.4.1)
14
+ rainbow (3.0.0)
15
+ rake (13.0.3)
16
+ regexp_parser (2.1.1)
17
+ rexml (3.2.5)
18
+ rspec (3.10.0)
19
+ rspec-core (~> 3.10.0)
20
+ rspec-expectations (~> 3.10.0)
21
+ rspec-mocks (~> 3.10.0)
22
+ rspec-core (3.10.1)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-expectations (3.10.1)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-mocks (3.10.2)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-support (3.10.2)
31
+ rubocop (1.14.0)
32
+ parallel (~> 1.10)
33
+ parser (>= 3.0.0.0)
34
+ rainbow (>= 2.2.2, < 4.0)
35
+ regexp_parser (>= 1.8, < 3.0)
36
+ rexml
37
+ rubocop-ast (>= 1.5.0, < 2.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (>= 1.4.0, < 3.0)
40
+ rubocop-ast (1.5.0)
41
+ parser (>= 3.0.1.1)
42
+ ruby-progressbar (1.11.0)
43
+ unicode-display_width (2.0.0)
44
+
45
+ PLATFORMS
46
+ x86_64-darwin-19
47
+
48
+ DEPENDENCIES
49
+ rake (~> 13.0)
50
+ rspec (~> 3.0)
51
+ rubocop (~> 1.7)
52
+ zxcvbn!
53
+
54
+ BUNDLED WITH
55
+ 2.2.15
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Rafael Santos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Zxcvbn
2
+
3
+ This is a direct Ruby port of Dropbox's [zxcvbn.js][zxcvbn.js] JavaScript library.
4
+ The intention is to provide all the same features and same results as close to the original JS fucntion would do.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'zxcvbn'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle install
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install zxcvbn
21
+
22
+ ## Usage
23
+
24
+ ```
25
+ Zxcvbn.zxcvbn("password")
26
+ => {
27
+ :password => "pasword",
28
+ :guesses => 3566,
29
+ :guesses_log10 => 3.5521813388393357,
30
+ :sequence => [
31
+ {
32
+ :pattern => "dictionary",
33
+ :i => 0,
34
+ :j => 6,
35
+ :token => "pasword",
36
+ :matched_word => "pasword",
37
+ :rank => 3565,
38
+ :dictionary_name => "passwords",
39
+ :reversed => false,
40
+ :l33t => false,
41
+ :base_guesses => 3565,
42
+ :uppercase_variations => 1,
43
+ :l33t_variations => 1,
44
+ :guesses => 3565,
45
+ :guesses_log10 => 3.5520595341878844
46
+ }
47
+ ],
48
+ :calc_time => 0,
49
+ :crack_times_seconds => {
50
+ :online_throttling_100_per_hour => 128376.0,
51
+ :online_no_throttling_10_per_second => 356.6,
52
+ :offline_slow_hashing_1e4_per_second => 0.3566,
53
+ :offline_fast_hashing_1e10_per_second => 3.566e-07
54
+ },
55
+ :crack_times_display => {
56
+ :online_throttling_100_per_hour => "1 day",
57
+ :online_no_throttling_10_per_second => "6 minutes",
58
+ :offline_slow_hashing_1e4_per_second => "less than a second",
59
+ :offline_fast_hashing_1e10_per_second => "less than a second"
60
+ },
61
+ :score => 1,
62
+ :feedback =>
63
+ {
64
+ :warning => "This is a very common password",
65
+ :suggestions => ["Add another word or two. Uncommon words are better."]
66
+ }
67
+ }
68
+ ```
69
+
70
+ ## Development
71
+
72
+ After 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.
73
+
74
+ To 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).
75
+
76
+ ## Contributing
77
+
78
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/zxcvbn. 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/[USERNAME]/zxcvbn/blob/master/CODE_OF_CONDUCT.md).
79
+
80
+ ## License
81
+
82
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
83
+
84
+ ## Code of Conduct
85
+
86
+ Everyone 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/[USERNAME]/zxcvbn/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "zxcvbn"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/zxcvbn.rb ADDED
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "zxcvbn/adjacency_graphs"
4
+ require_relative "zxcvbn/frequency_lists"
5
+ require_relative "zxcvbn/matching"
6
+ require_relative "zxcvbn/scoring"
7
+ require_relative "zxcvbn/time_estimates"
8
+ require_relative "zxcvbn/feedback"
9
+ require_relative "zxcvbn/version"
10
+
11
+ module Zxcvbn
12
+ class Error < StandardError; end
13
+
14
+ def self.zxcvbn(password, user_inputs = [])
15
+ start = (Time.now.to_f * 1000).to_i
16
+ # reset the user inputs matcher on a per-request basis to keep things stateless
17
+ sanitized_inputs = [];
18
+ user_inputs.each do |arg|
19
+ if arg.is_a?(String) || arg.is_a?(Numeric) || arg == true || arg == false
20
+ sanitized_inputs << arg.to_s.downcase
21
+ end
22
+ end
23
+ Matching.set_user_input_dictionary(sanitized_inputs)
24
+ matches = Matching.omnimatch(password)
25
+ result = Scoring.most_guessable_match_sequence(password, matches)
26
+ result[:calc_time] = (Time.now.to_f * 1000).to_i - start
27
+ attack_times = TimeEstimates.estimate_attack_times(result[:guesses])
28
+ attack_times.each do |prop, val|
29
+ result[prop] = val
30
+ end
31
+ result[:feedback] = Feedback.get_feedback(result[:score], result[:sequence])
32
+ return result
33
+ end
34
+ end
@@ -0,0 +1,234 @@
1
+ # frozen_string_literal: true
2
+
3
+ # generated by scripts/build_keyboard_adjacency_graphs.py
4
+ module Zxcvbn
5
+ ADJACENCY_GRAPHS = {
6
+ qwerty: {
7
+ "!": ["`~", nil, nil, "2@", "qQ", nil],
8
+ "\"": [";:", "[{", "]}", nil, nil, "/?"],
9
+ "#": ["2@", nil, nil, "4$", "eE", "wW"],
10
+ "$": ["3#", nil, nil, "5%", "rR", "eE"],
11
+ "%": ["4$", nil, nil, "6^", "tT", "rR"],
12
+ "&": ["6^", nil, nil, "8*", "uU", "yY"],
13
+ "'": [";:", "[{", "]}", nil, nil, "/?"],
14
+ "(": ["8*", nil, nil, "0)", "oO", "iI"],
15
+ ")": ["9(", nil, nil, "-_", "pP", "oO"],
16
+ "*": ["7&", nil, nil, "9(", "iI", "uU"],
17
+ "+": ["-_", nil, nil, nil, "]}", "[{"],
18
+ ",": ["mM", "kK", "lL", ".>", nil, nil],
19
+ "-": ["0)", nil, nil, "=+", "[{", "pP"],
20
+ ".": [",<", "lL", ";:", "/?", nil, nil],
21
+ "/": [".>", ";:", "'\"", nil, nil, nil],
22
+ "0": ["9(", nil, nil, "-_", "pP", "oO"],
23
+ "1": ["`~", nil, nil, "2@", "qQ", nil],
24
+ "2": ["1!", nil, nil, "3#", "wW", "qQ"],
25
+ "3": ["2@", nil, nil, "4$", "eE", "wW"],
26
+ "4": ["3#", nil, nil, "5%", "rR", "eE"],
27
+ "5": ["4$", nil, nil, "6^", "tT", "rR"],
28
+ "6": ["5%", nil, nil, "7&", "yY", "tT"],
29
+ "7": ["6^", nil, nil, "8*", "uU", "yY"],
30
+ "8": ["7&", nil, nil, "9(", "iI", "uU"],
31
+ "9": ["8*", nil, nil, "0)", "oO", "iI"],
32
+ ":": ["lL", "pP", "[{", "'\"", "/?", ".>"],
33
+ ";": ["lL", "pP", "[{", "'\"", "/?", ".>"],
34
+ "<": ["mM", "kK", "lL", ".>", nil, nil],
35
+ "=": ["-_", nil, nil, nil, "]}", "[{"],
36
+ ">": [",<", "lL", ";:", "/?", nil, nil],
37
+ "?": [".>", ";:", "'\"", nil, nil, nil],
38
+ "@": ["1!", nil, nil, "3#", "wW", "qQ"],
39
+ "A": [ nil, "qQ", "wW", "sS", "zZ", nil],
40
+ "B": ["vV", "gG", "hH", "nN", nil, nil],
41
+ "C": ["xX", "dD", "fF", "vV", nil, nil],
42
+ "D": ["sS", "eE", "rR", "fF", "cC", "xX"],
43
+ "E": ["wW", "3#", "4$", "rR", "dD", "sS"],
44
+ "F": ["dD", "rR", "tT", "gG", "vV", "cC"],
45
+ "G": ["fF", "tT", "yY", "hH", "bB", "vV"],
46
+ "H": ["gG", "yY", "uU", "jJ", "nN", "bB"],
47
+ "I": ["uU", "8*", "9(", "oO", "kK", "jJ"],
48
+ "J": ["hH", "uU", "iI", "kK", "mM", "nN"],
49
+ "K": ["jJ", "iI", "oO", "lL", ",<", "mM"],
50
+ "L": ["kK", "oO", "pP", ";:", ".>", ",<"],
51
+ "M": ["nN", "jJ", "kK", ",<", nil, nil],
52
+ "N": ["bB", "hH", "jJ", "mM", nil, nil],
53
+ "O": ["iI", "9(", "0)", "pP", "lL", "kK"],
54
+ "P": ["oO", "0)", "-_", "[{", ";:", "lL"],
55
+ "Q": [ nil, "1!", "2@", "wW", "aA", nil],
56
+ "R": ["eE", "4$", "5%", "tT", "fF", "dD"],
57
+ "S": ["aA", "wW", "eE", "dD", "xX", "zZ"],
58
+ "T": ["rR", "5%", "6^", "yY", "gG", "fF"],
59
+ "U": ["yY", "7&", "8*", "iI", "jJ", "hH"],
60
+ "V": ["cC", "fF", "gG", "bB", nil, nil],
61
+ "W": ["qQ", "2@", "3#", "eE", "sS", "aA"],
62
+ "X": ["zZ", "sS", "dD", "cC", nil, nil],
63
+ "Y": ["tT", "6^", "7&", "uU", "hH", "gG"],
64
+ "Z": [ nil, "aA", "sS", "xX", nil, nil],
65
+ "[": ["pP", "-_", "=+", "]}", "'\"", ";:"],
66
+ "\\": ["]}", nil, nil, nil, nil, nil],
67
+ "]": ["[{", "=+", nil, "\\|", nil, "'\""],
68
+ "^": ["5%", nil, nil, "7&", "yY", "tT"],
69
+ "_": ["0)", nil, nil, "=+", "[{", "pP"],
70
+ "`": [ nil, nil, nil, "1!", nil, nil],
71
+ "a": [ nil, "qQ", "wW", "sS", "zZ", nil],
72
+ "b": ["vV", "gG", "hH", "nN", nil, nil],
73
+ "c": ["xX", "dD", "fF", "vV", nil, nil],
74
+ "d": ["sS", "eE", "rR", "fF", "cC", "xX"],
75
+ "e": ["wW", "3#", "4$", "rR", "dD", "sS"],
76
+ "f": ["dD", "rR", "tT", "gG", "vV", "cC"],
77
+ "g": ["fF", "tT", "yY", "hH", "bB", "vV"],
78
+ "h": ["gG", "yY", "uU", "jJ", "nN", "bB"],
79
+ "i": ["uU", "8*", "9(", "oO", "kK", "jJ"],
80
+ "j": ["hH", "uU", "iI", "kK", "mM", "nN"],
81
+ "k": ["jJ", "iI", "oO", "lL", ",<", "mM"],
82
+ "l": ["kK", "oO", "pP", ";:", ".>", ",<"],
83
+ "m": ["nN", "jJ", "kK", ",<", nil, nil],
84
+ "n": ["bB", "hH", "jJ", "mM", nil, nil],
85
+ "o": ["iI", "9(", "0)", "pP", "lL", "kK"],
86
+ "p": ["oO", "0)", "-_", "[{", ";:", "lL"],
87
+ "q": [ nil, "1!", "2@", "wW", "aA", nil],
88
+ "r": ["eE", "4$", "5%", "tT", "fF", "dD"],
89
+ "s": ["aA", "wW", "eE", "dD", "xX", "zZ"],
90
+ "t": ["rR", "5%", "6^", "yY", "gG", "fF"],
91
+ "u": ["yY", "7&", "8*", "iI", "jJ", "hH"],
92
+ "v": ["cC", "fF", "gG", "bB", nil, nil],
93
+ "w": ["qQ", "2@", "3#", "eE", "sS", "aA"],
94
+ "x": ["zZ", "sS", "dD", "cC", nil, nil],
95
+ "y": ["tT", "6^", "7&", "uU", "hH", "gG"],
96
+ "z": [ nil, "aA", "sS", "xX", nil, nil],
97
+ "{": ["pP", "-_", "=+", "]}", "'\"", ";:"],
98
+ "|": ["]}", nil, nil, nil, nil, nil],
99
+ "}": ["[{", "=+", nil, "\\|", nil, "'\""],
100
+ "~": [ nil, nil, nil, "1!", nil, nil]
101
+ },
102
+ dvorak: {
103
+ "!": ["`~", nil, nil, "2@", "'\"", nil],
104
+ "\"": [ nil, "1!", "2@", ",<", "aA", nil],
105
+ "#": ["2@", nil, nil, "4$", ".>", ",<"],
106
+ "$": ["3#", nil, nil, "5%", "pP", ".>"],
107
+ "%": ["4$", nil, nil, "6^", "yY", "pP"],
108
+ "&": ["6^", nil, nil, "8*", "gG", "fF"],
109
+ "'": [ nil, "1!", "2@", ",<", "aA", nil],
110
+ "(": ["8*", nil, nil, "0)", "rR", "cC"],
111
+ ")": ["9(", nil, nil, "[{", "lL", "rR"],
112
+ "*": ["7&", nil, nil, "9(", "cC", "gG"],
113
+ "+": ["/?", "]}", nil, "\\|", nil, "-_"],
114
+ ",": ["'\"", "2@", "3#", ".>", "oO", "aA"],
115
+ "-": ["sS", "/?", "=+", nil, nil, "zZ"],
116
+ ".": [",<", "3#", "4$", "pP", "eE", "oO"],
117
+ "/": ["lL", "[{", "]}", "=+", "-_", "sS"],
118
+ "0": ["9(", nil, nil, "[{", "lL", "rR"],
119
+ "1": ["`~", nil, nil, "2@", "'\"", nil],
120
+ "2": ["1!", nil, nil, "3#", ",<", "'\""],
121
+ "3": ["2@", nil, nil, "4$", ".>", ",<"],
122
+ "4": ["3#", nil, nil, "5%", "pP", ".>"],
123
+ "5": ["4$", nil, nil, "6^", "yY", "pP"],
124
+ "6": ["5%", nil, nil, "7&", "fF", "yY"],
125
+ "7": ["6^", nil, nil, "8*", "gG", "fF"],
126
+ "8": ["7&", nil, nil, "9(", "cC", "gG"],
127
+ "9": ["8*", nil, nil, "0)", "rR", "cC"],
128
+ ":": [ nil, "aA", "oO", "qQ", nil, nil],
129
+ ";": [ nil, "aA", "oO", "qQ", nil, nil],
130
+ "<": ["'\"", "2@", "3#", ".>", "oO", "aA"],
131
+ "=": ["/?", "]}", nil, "\\|", nil, "-_"],
132
+ ">": [",<", "3#", "4$", "pP", "eE", "oO"],
133
+ "?": ["lL", "[{", "]}", "=+", "-_", "sS"],
134
+ "@": ["1!", nil, nil, "3#", ",<", "'\""],
135
+ "A": [ nil, "'\"", ",<", "oO", ";:", nil],
136
+ "B": ["xX", "dD", "hH", "mM", nil, nil],
137
+ "C": ["gG", "8*", "9(", "rR", "tT", "hH"],
138
+ "D": ["iI", "fF", "gG", "hH", "bB", "xX"],
139
+ "E": ["oO", ".>", "pP", "uU", "jJ", "qQ"],
140
+ "F": ["yY", "6^", "7&", "gG", "dD", "iI"],
141
+ "G": ["fF", "7&", "8*", "cC", "hH", "dD"],
142
+ "H": ["dD", "gG", "cC", "tT", "mM", "bB"],
143
+ "I": ["uU", "yY", "fF", "dD", "xX", "kK"],
144
+ "J": ["qQ", "eE", "uU", "kK", nil, nil],
145
+ "K": ["jJ", "uU", "iI", "xX", nil, nil],
146
+ "L": ["rR", "0)", "[{", "/?", "sS", "nN"],
147
+ "M": ["bB", "hH", "tT", "wW", nil, nil],
148
+ "N": ["tT", "rR", "lL", "sS", "vV", "wW"],
149
+ "O": ["aA", ",<", ".>", "eE", "qQ", ";:"],
150
+ "P": [".>", "4$", "5%", "yY", "uU", "eE"],
151
+ "Q": [";:", "oO", "eE", "jJ", nil, nil],
152
+ "R": ["cC", "9(", "0)", "lL", "nN", "tT"],
153
+ "S": ["nN", "lL", "/?", "-_", "zZ", "vV"],
154
+ "T": ["hH", "cC", "rR", "nN", "wW", "mM"],
155
+ "U": ["eE", "pP", "yY", "iI", "kK", "jJ"],
156
+ "V": ["wW", "nN", "sS", "zZ", nil, nil],
157
+ "W": ["mM", "tT", "nN", "vV", nil, nil],
158
+ "X": ["kK", "iI", "dD", "bB", nil, nil],
159
+ "Y": ["pP", "5%", "6^", "fF", "iI", "uU"],
160
+ "Z": ["vV", "sS", "-_", nil, nil, nil],
161
+ "[": ["0)", nil, nil, "]}", "/?", "lL"],
162
+ "\\": ["=+", nil, nil, nil, nil, nil],
163
+ "]": ["[{", nil, nil, nil, "=+", "/?"],
164
+ "^": ["5%", nil, nil, "7&", "fF", "yY"],
165
+ "_": ["sS", "/?", "=+", nil, nil, "zZ"],
166
+ "`": [ nil, nil, nil, "1!", nil, nil],
167
+ "a": [ nil, "'\"", ",<", "oO", ";:", nil],
168
+ "b": ["xX", "dD", "hH", "mM", nil, nil],
169
+ "c": ["gG", "8*", "9(", "rR", "tT", "hH"],
170
+ "d": ["iI", "fF", "gG", "hH", "bB", "xX"],
171
+ "e": ["oO", ".>", "pP", "uU", "jJ", "qQ"],
172
+ "f": ["yY", "6^", "7&", "gG", "dD", "iI"],
173
+ "g": ["fF", "7&", "8*", "cC", "hH", "dD"],
174
+ "h": ["dD", "gG", "cC", "tT", "mM", "bB"],
175
+ "i": ["uU", "yY", "fF", "dD", "xX", "kK"],
176
+ "j": ["qQ", "eE", "uU", "kK", nil, nil],
177
+ "k": ["jJ", "uU", "iI", "xX", nil, nil],
178
+ "l": ["rR", "0)", "[{", "/?", "sS", "nN"],
179
+ "m": ["bB", "hH", "tT", "wW", nil, nil],
180
+ "n": ["tT", "rR", "lL", "sS", "vV", "wW"],
181
+ "o": ["aA", ",<", ".>", "eE", "qQ", ";:"],
182
+ "p": [".>", "4$", "5%", "yY", "uU", "eE"],
183
+ "q": [";:", "oO", "eE", "jJ", nil, nil],
184
+ "r": ["cC", "9(", "0)", "lL", "nN", "tT"],
185
+ "s": ["nN", "lL", "/?", "-_", "zZ", "vV"],
186
+ "t": ["hH", "cC", "rR", "nN", "wW", "mM"],
187
+ "u": ["eE", "pP", "yY", "iI", "kK", "jJ"],
188
+ "v": ["wW", "nN", "sS", "zZ", nil, nil],
189
+ "w": ["mM", "tT", "nN", "vV", nil, nil],
190
+ "x": ["kK", "iI", "dD", "bB", nil, nil],
191
+ "y": ["pP", "5%", "6^", "fF", "iI", "uU"],
192
+ "z": ["vV", "sS", "-_", nil, nil, nil],
193
+ "{": ["0)", nil, nil, "]}", "/?", "lL"],
194
+ "|": ["=+", nil, nil, nil, nil, nil],
195
+ "}": ["[{", nil, nil, nil, "=+", "/?"],
196
+ "~": [ nil, nil, nil, "1!", nil, nil]
197
+ },
198
+ keypad: {
199
+ "*": ["/", nil, nil, nil, "-", "+", "9", "8"],
200
+ "+": ["9", "*", "-", nil, nil, nil, nil, "6"],
201
+ "-": ["*", nil, nil, nil, nil, nil, "+", "9"],
202
+ ".": ["0", "2", "3", nil, nil, nil, nil, nil],
203
+ "/": [ nil, nil, nil, nil, "*", "9", "8", "7"],
204
+ "0": [ nil, "1", "2", "3", ".", nil, nil, nil],
205
+ "1": [ nil, nil, "4", "5", "2", "0", nil, nil],
206
+ "2": ["1", "4", "5", "6", "3", ".", "0", nil],
207
+ "3": ["2", "5", "6", nil, nil, nil, ".", "0"],
208
+ "4": [ nil, nil, "7", "8", "5", "2", "1", nil],
209
+ "5": ["4", "7", "8", "9", "6", "3", "2", "1"],
210
+ "6": ["5", "8", "9", "+", nil, nil, "3", "2"],
211
+ "7": [ nil, nil, nil, "/", "8", "5", "4", nil],
212
+ "8": ["7", nil, "/", "*", "9", "6", "5", "4"],
213
+ "9": ["8", "/", "*", "-", "+", nil, "6", "5"]
214
+ },
215
+ mac_keypad: {
216
+ "*": ["/", nil, nil, nil, nil, nil, "-", "9"],
217
+ "+": ["6", "9", "-", nil, nil, nil, nil, "3"],
218
+ "-": ["9", "/", "*", nil, nil, nil, "+", "6"],
219
+ ".": ["0", "2", "3", nil, nil, nil, nil, nil],
220
+ "/": ["=", nil, nil, nil, "*", "-", "9", "8"],
221
+ "0": [ nil, "1", "2", "3", ".", nil, nil, nil],
222
+ "1": [ nil, nil, "4", "5", "2", "0", nil, nil],
223
+ "2": ["1", "4", "5", "6", "3", ".", "0", nil],
224
+ "3": ["2", "5", "6", "+", nil, nil, ".", "0"],
225
+ "4": [ nil, nil, "7", "8", "5", "2", "1", nil],
226
+ "5": ["4", "7", "8", "9", "6", "3", "2", "1"],
227
+ "6": ["5", "8", "9", "-", "+", nil, "3", "2"],
228
+ "7": [ nil, nil, nil, "=", "8", "5", "4", nil],
229
+ "8": ["7", nil, "=", "/", "9", "6", "5", "4"],
230
+ "9": ["8", "=", "/", "*", "-", "+", "6", "5"],
231
+ "=": [ nil, nil, nil, nil, "/", "9", "8", "7"]
232
+ }
233
+ }
234
+ end