git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit 3aa15b624d1372f5289a864fcdb20410bc9eb20f

Merge pull request #107 from mattwildig/version-attribute-string

Make version attribute a plain String
T.J. Schuck committed on 1/29/2015, 4:13:12 AM
Parent: b82c7140eb4ecedc20ab3a7c0d0801667d1907b3
Parent: f1621d686b6c41ae4157667b3f76735cfbbc60e5

Files changed

lib/bcrypt/password.rbchanged
spec/bcrypt/password_spec.rbchanged
lib/bcrypt/password.rbView
@@ -79,9 +79,9 @@
7979 #
8080 # Splits +h+ into version, cost, salt, and hash and returns them in that order.
8181 def split_hash(h)
8282 _, v, c, mash = h.split('$')
83- return v, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str
83+ return v.to_str, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str
8484 end
8585 end
8686
8787 end
spec/bcrypt/password_spec.rbView
@@ -74,8 +74,9 @@
7474
7575 specify "should read the version, cost, salt, and hash" do
7676 password = BCrypt::Password.new(@hash)
7777 expect(password.version).to eql("2a")
78+ expect(password.version.class).to eq String
7879 expect(password.cost).to equal(5)
7980 expect(password.salt).to eql("$2a$05$CCCCCCCCCCCCCCCCCCCCC.")
8081 expect(password.salt.class).to eq String
8182 expect(password.checksum).to eq("E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW")

Built with git-ssb-web