git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



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.rbchanged
lib/bcrypt/password.rbchanged
lib/bcrypt/engine.rbView
@@ -41,15 +41,11 @@
4141 end
4242
4343 # Given a secret and a valid salt (see BCrypt::Engine.generate_salt) calculates
4444 # a bcrypt() password hash.
45- def self.hash_secret(secret, salt, cost = nil)
45+ def self.hash_secret(secret, salt, _ = nil)
4646 if valid_secret?(secret)
4747 if valid_salt?(salt)
48- if cost.nil?
49- cost = autodetect_cost(salt)
50- end
51-
5248 if RUBY_PLATFORM == "java"
5349 Java.bcrypt_jruby.BCrypt.hashpw(secret.to_s, salt.to_s)
5450 else
5551 __bc_crypt(secret.to_s, salt)
lib/bcrypt/password.rbView
@@ -42,9 +42,9 @@
4242 # @password = BCrypt::Password.create("my secret", :cost => 13)
4343 def create(secret, options = {})
4444 cost = options[:cost] || BCrypt::Engine.cost
4545 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)))
4747 end
4848
4949 def valid_hash?(h)
5050 h =~ /^\$[0-9a-z]{2}\$[0-9]{2}\$[A-Za-z0-9\.\/]{53}$/

Built with git-ssb-web