Skip to content

Commit

Permalink
Bump version to 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
philnash committed Jul 8, 2020
1 parent 3575d9d commit 51f2b6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Ongoing [](https://github.com/philnash/pwned/compare/v2.0.2...master)

## 2.1.0 (July 8, 2020) [](https://github.com/philnash/pwned/compare/v2.0.2...v2.1.0)

- Minor updates

- Adds `Pwned::HashedPassword` class which is initializd with a SHA1 hash to
query the API with so that the lookup can be done in the background without
storing passwords. Fixes #19, thanks [@paprikati](https://github.com/paprikati).

## 2.0.2 (May 20, 2020) [](https://github.com/philnash/pwned/compare/v2.0.1...v2.0.2)

- Minor fix
Expand Down
5 changes: 3 additions & 2 deletions lib/pwned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def self.pwned_count(password, request_options={})
# @example
# Pwned.hash_password("password") #=> 5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8
#
# @param password [String] The password you want to check against the API.
# @since TBC
# @param password [String] The password you want to check against the API
# @return [String] An uppercase SHA1 hash of the password
# @since 2.1.0
def self.hash_password(password)
Digest::SHA1.hexdigest(password).upcase
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pwned/hashed_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HashedPassword
# @option request_options [Symbol] :headers ({ "User-Agent" => "Ruby Pwned::Password #{Pwned::VERSION}" })
# HTTP headers to include in the request
# @raise [TypeError] if the password is not a string.
# @since 1.1.0
# @since 2.1.0
def initialize(hashed_password, request_options={})
raise TypeError, "hashed_password must be of type String" unless hashed_password.is_a? String
@hashed_password = hashed_password.upcase
Expand Down
2 changes: 1 addition & 1 deletion lib/pwned/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
module Pwned
##
# The current version of the +pwned+ gem.
VERSION = "2.0.2"
VERSION = "2.1.0"
end

0 comments on commit 51f2b6a

Please sign in to comment.