zxcvbn 0.1.5 → 0.1.6

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: 50df44a0d9bdff1e7b99f5ef1fac71d95a5bc23bf1d01d302bd23a8d6e027d1e
4
- data.tar.gz: 4f7c36d4c57b193b72b4964e002931cf665851b8bfb13ccfd7b0f7ea74773840
3
+ metadata.gz: 8ed77be628881ddd6bd6df0f7a60935e193db7cf91f5c928319eed9ac24295bf
4
+ data.tar.gz: 20906d11011e8ab3f95dcc9f20cae21b6945999a979b11c452b23f02726abda6
5
5
  SHA512:
6
- metadata.gz: 7210bdcd7b53a785cdc046b6886ba99f02da09905638eacf4f8acbebbd7c3f4e57121f9bf9e49650c2aae2c1b1a782bc7736edfc378ca40d2a5082ce4682133d
7
- data.tar.gz: 600e750ee98acd0c1fa070cdf7144324165a894eb42eeff336e5e59d57be8e8c08fe06f9bb70ef5827208077febe0039783d5ef16aecde2eb4458fffa7594eaa
6
+ metadata.gz: a6ac81d9c47f5f4a006b7e5e071f0f2fd119d0f9f721d28d7725ab07f8eafa4478f727652b7e51a87d82d5022e761550cecc6f83ff2f38b8cd0171d51061f97b
7
+ data.tar.gz: ec59a970bc9037714b93c3d73738b995afa224c25cdca4dd8309e74f7e11df58fe7f618f72805ea004f23ac3387a8f98fa2548d9d2c00419231f7e0e07307db7
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
+ ## [0.1.6] - 2021-05-28
2
+ - Added test methods for compatibility with zxcvbn-js and zxcvbn-ruby.
3
+
4
+ ## [0.1.5] - 2021-05-27
5
+ - Fix classification of scoring causing differences between js and ruby.
6
+
1
7
  ## [0.1.4] - 2021-05-16
2
8
 
3
- - Bunch of fixes, eall example passwords included have same result as js version.
9
+ - Bunch of fixes, all example passwords included have same result as js version.
4
10
  - consistent code style applied.
5
11
 
6
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zxcvbn (0.1.5)
4
+ zxcvbn (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # Zxcvbn
2
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.
3
+ [![Gem Version](https://badge.fury.io/rb/zxcvbn.svg)](https://badge.fury.io/rb/zxcvbn)
4
+ [![Build Status](https://travis-ci.com/formigarafa/zxcvbn-rb.svg?branch=master)](https://travis-ci.com/formigarafa/zxcvbn-rb)
5
+
6
+ Ruby port of Dropbox's [zxcvbn.js][zxcvbn.js] JavaScript library running completely in Ruby (no need to load execjs or libv8).
7
+
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).
5
9
 
6
10
  ## Installation
7
11
 
@@ -67,6 +71,10 @@ Zxcvbn.zxcvbn("password")
67
71
  }
68
72
  ```
69
73
 
74
+ ### Compatible with `zxcvbn-js` and `zxcvbn-ruby`
75
+
76
+ This gem include a compatible interface so it can be used as a drop-in substitution for `zxcvbn-js` or `zxcvbn-ruby`. You can just call `Zxcvbn.test` or use `Zxcvbn::Tester.new` the same way as you would if you were using `zxcvbn-js` or `zxcvbn-ruby`.
77
+
70
78
  ## Development
71
79
 
72
80
  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.
data/lib/zxcvbn.rb CHANGED
@@ -29,4 +29,14 @@ module Zxcvbn
29
29
  result["feedback"] = Feedback.get_feedback(result["score"], result["sequence"])
30
30
  result
31
31
  end
32
+
33
+ def self.test(password, user_inputs = [])
34
+ OpenStruct.new(Zxcvbn.zxcvbn(password, user_inputs))
35
+ end
36
+
37
+ class Tester
38
+ def test(password, user_inputs = [])
39
+ Zxcvbn.test(password, user_inputs)
40
+ end
41
+ end
32
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zxcvbn
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/zxcvbn.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["formigarafa@gmail.com"]
10
10
 
11
11
  spec.summary = ""
12
- spec.description = "Ruby port of Dropbox's zxcvbn.js"
12
+ spec.description = "100% native Ruby 100% compatible port of Dropbox's zxcvbn.js"
13
13
  spec.homepage = "http://github.com/formigarafa/zxcvbn-rb"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zxcvbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-27 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Ruby port of Dropbox's zxcvbn.js
13
+ description: 100% native Ruby 100% compatible port of Dropbox's zxcvbn.js
14
14
  email:
15
15
  - formigarafa@gmail.com
16
16
  executables: []