zxcvbn 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ed77be628881ddd6bd6df0f7a60935e193db7cf91f5c928319eed9ac24295bf
4
- data.tar.gz: 20906d11011e8ab3f95dcc9f20cae21b6945999a979b11c452b23f02726abda6
3
+ metadata.gz: 497a8237437937a17ce899c92181dcc11f32e164ca5515ba2739ac02e59f79b2
4
+ data.tar.gz: 0e0ee12a70d1814db3178c9d925a43b22036c3c5c1444dd2ed38873c5c5686a7
5
5
  SHA512:
6
- metadata.gz: a6ac81d9c47f5f4a006b7e5e071f0f2fd119d0f9f721d28d7725ab07f8eafa4478f727652b7e51a87d82d5022e761550cecc6f83ff2f38b8cd0171d51061f97b
7
- data.tar.gz: ec59a970bc9037714b93c3d73738b995afa224c25cdca4dd8309e74f7e11df58fe7f618f72805ea004f23ac3387a8f98fa2548d9d2c00419231f7e0e07307db7
6
+ metadata.gz: ab0bf4b0709602f08bdb20caae26f124487c3dac8d1f35ef04fb728a0bda822e68ad35db065d28be15745a7c61705ecb402cc7fb463209d8bbc24ca3d8edf379
7
+ data.tar.gz: e03692c3985a020195e1304451dcd3c91b847d9ef2c391ba62ce61b33f08251a73f195877618a649bd847dd4736769de0b31779a5a61e6b7ab2b23ca946cda81
data/.travis.yml CHANGED
@@ -3,4 +3,7 @@ language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
5
  - 2.5.9
6
+ - 2.6.7
7
+ - 2.7.3
8
+ - 3.0.1
6
9
  before_install: gem install bundler -v 2.2.15
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.1.7] - 2021-06-12
2
+ - Ported original specs
3
+ - Fix difference found on enumerate_l33t_subs
4
+ - Setup to also test against current versions of ruby
5
+
1
6
  ## [0.1.6] - 2021-05-28
2
7
  - Added test methods for compatibility with zxcvbn-js and zxcvbn-ruby.
3
8
 
@@ -9,7 +14,6 @@
9
14
  - Bunch of fixes, all example passwords included have same result as js version.
10
15
  - consistent code style applied.
11
16
 
12
-
13
17
  ## [0.1.0] - 2021-05-16
14
18
 
15
19
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zxcvbn (0.1.6)
4
+ zxcvbn (0.1.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/zxcvbn.svg)](https://badge.fury.io/rb/zxcvbn)
4
4
  [![Build Status](https://travis-ci.com/formigarafa/zxcvbn-rb.svg?branch=master)](https://travis-ci.com/formigarafa/zxcvbn-rb)
5
5
 
6
- Ruby port of Dropbox's [zxcvbn.js][zxcvbn.js] JavaScript library running completely in Ruby (no need to load execjs or libv8).
6
+ Ruby port of Dropbox's [zxcvbn.js](https://github.com/dropbox/zxcvbn) JavaScript library running completely in Ruby (no need to load execjs or libv8).
7
7
 
8
8
  The intention is to provide an option 100% Ruby solution with all the same features and same results (or as close to the original JS function as possible).
9
9
 
@@ -112,10 +112,6 @@ module Zxcvbn
112
112
  ]
113
113
  }.freeze
114
114
 
115
- def self.empty(obj)
116
- obj.empty?
117
- end
118
-
119
115
  def self.translate(string, chr_map)
120
116
  string.chars.map { |chr| chr_map[chr] || chr }.join
121
117
  end
@@ -250,7 +246,7 @@ module Zxcvbn
250
246
  end
251
247
  end
252
248
  if dup_l33t_index == -1
253
- sub_extension = sub.concat([[l33t_chr, first_key]])
249
+ sub_extension = sub + [[l33t_chr, first_key]]
254
250
  next_subs << sub_extension
255
251
  else
256
252
  sub_alternative = sub.dup
@@ -283,7 +279,7 @@ module Zxcvbn
283
279
  def self.l33t_match(password, _ranked_dictionaries = RANKED_DICTIONARIES, _l33t_table = L33T_TABLE)
284
280
  matches = []
285
281
  enumerate_l33t_subs(relevant_l33t_subtable(password, _l33t_table)).each do |sub|
286
- break if empty(sub) # corner case: password has no relevant subs.
282
+ break if sub.empty? # corner case: password has no relevant subs.
287
283
 
288
284
  subbed_password = translate(password, sub)
289
285
  dictionary_match(subbed_password, _ranked_dictionaries).each do |match|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zxcvbn
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zxcvbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Santos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-28 00:00:00.000000000 Z
11
+ date: 2021-06-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 100% native Ruby 100% compatible port of Dropbox's zxcvbn.js
14
14
  email: