zxcvbn 0.1.11 → 0.1.12

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: 3db0500997ddeac85fd658feb95636cd94bb714f7673117d04579a132b5397a5
4
- data.tar.gz: ae7fbf75514c516b3ee5ebe32853a8edf40418f4f0d41a50c0b1d7881cec406a
3
+ metadata.gz: 3abba874325220873de3e16bf2213afe1e51c468e6c5059ee793641563bbd123
4
+ data.tar.gz: e555337f55746d9fc2b2339797e287fb1a16c292d2d2b4aa54fdcfa0c7fbe370
5
5
  SHA512:
6
- metadata.gz: 1866f718e046cac257346e493d97554f13bae86505c1b994aeb2161fc123c29b4d4dce2da3fabbdce1fdcfa5e2570d0f7766065f4e4462ebec0dbf2187cf31bc
7
- data.tar.gz: a168812ae6a99bed3c288fbe497b8633fe834f7d25e6828c9c8ba48b785da016d432c82f99b9273a89abe74e7c40a15b470b70c29b16e8b75d2b6193d263495b
6
+ metadata.gz: ec032e5e93416aef8ea9526cc4ff39e90a381228965c718f50f0311f900c8c1029d1ad13b7efd88f79c3fa890e5fd0b6c61d3252131430e7f19b383e55e62767
7
+ data.tar.gz: 5174f7aa4a0a65beefc790ea0f252abc749a203022b05d6b9ce33a6771599d6c41a33c2b341cda009eb0aad9d4d9df6da5b7cd308c2d3fb566657aafcecd0fab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.1.12] - 2024-10-29
2
+ - [16] Stop using OpenStruct
3
+
4
+ *Mitchell Henke (@mitchellhenke)*
5
+
1
6
  ## [0.1.11] - 2024-08-25
2
7
  - [13] Reduce object allocations (continuation)
3
8
  - [12] Reduce object allocations
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zxcvbn
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.12"
5
5
  end
data/lib/zxcvbn.rb CHANGED
@@ -10,6 +10,18 @@ require_relative "zxcvbn/version"
10
10
 
11
11
  module Zxcvbn
12
12
  class Error < StandardError; end
13
+ Result = Struct.new(
14
+ :password,
15
+ :guesses,
16
+ :guesses_log10,
17
+ :sequence,
18
+ :calc_time,
19
+ :crack_times_seconds,
20
+ :crack_times_display,
21
+ :score,
22
+ :feedback,
23
+ keyword_init: true
24
+ )
13
25
 
14
26
  def self.zxcvbn(password, user_inputs = [])
15
27
  start = (Time.now.to_f * 1000).to_i
@@ -25,7 +37,7 @@ module Zxcvbn
25
37
  end
26
38
 
27
39
  def self.test(password, user_inputs = [])
28
- OpenStruct.new(Zxcvbn.zxcvbn(password, user_inputs)) # rubocop:disable Style/OpenStructUse
40
+ Result.new(Zxcvbn.zxcvbn(password, user_inputs))
29
41
  end
30
42
 
31
43
  class Tester
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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Santos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-25 00:00:00.000000000 Z
11
+ date: 2024-10-29 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: