Commit 2ec9dacebb3345a9db2541e7dc7e7bea00147661
Merge pull request #74 from jjoos/master
Removing not used variable cost.T.J. Schuck committed on 9/3/2013, 3:51:21 PM
Parent: 769920d5c5f762c4dde6b6623110160a7ced463f
Parent: 0d19af419d4f7e4ff2eb81db4daa950144f10600
Files changed
lib/bcrypt/engine.rb | changed |
lib/bcrypt/password.rb | changed |
lib/bcrypt/engine.rb | ||
---|---|---|
@@ -41,15 +41,11 @@ | ||
41 | 41 | end |
42 | 42 | |
43 | 43 | # Given a secret and a valid salt (see BCrypt::Engine.generate_salt) calculates |
44 | 44 | # a bcrypt() password hash. |
45 | - def self.hash_secret(secret, salt, cost = nil) | |
45 | + def self.hash_secret(secret, salt, _ = nil) | |
46 | 46 | if valid_secret?(secret) |
47 | 47 | if valid_salt?(salt) |
48 | - if cost.nil? | |
49 | - cost = autodetect_cost(salt) | |
50 | - end | |
51 | - | |
52 | 48 | if RUBY_PLATFORM == "java" |
53 | 49 | Java.bcrypt_jruby.BCrypt.hashpw(secret.to_s, salt.to_s) |
54 | 50 | else |
55 | 51 | __bc_crypt(secret.to_s, salt) |
lib/bcrypt/password.rb | ||
---|---|---|
@@ -42,9 +42,9 @@ | ||
42 | 42 | # @password = BCrypt::Password.create("my secret", :cost => 13) |
43 | 43 | def create(secret, options = {}) |
44 | 44 | cost = options[:cost] || BCrypt::Engine.cost |
45 | 45 | raise ArgumentError if cost > 31 |
46 | - Password.new(BCrypt::Engine.hash_secret(secret, BCrypt::Engine.generate_salt(cost), cost)) | |
46 | + Password.new(BCrypt::Engine.hash_secret(secret, BCrypt::Engine.generate_salt(cost))) | |
47 | 47 | end |
48 | 48 | |
49 | 49 | def valid_hash?(h) |
50 | 50 | h =~ /^\$[0-9a-z]{2}\$[0-9]{2}\$[A-Za-z0-9\.\/]{53}$/ |
Built with git-ssb-web