Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bcrypt/password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def valid_hash?(h)
# Splits +h+ into version, cost, salt, and hash and returns them in that order.
def split_hash(h)
_, v, c, mash = h.split('$')
return v, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str
return v.to_str, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/bcrypt/password_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
specify "should read the version, cost, salt, and hash" do
password = BCrypt::Password.new(@hash)
expect(password.version).to eql("2a")
expect(password.version.class).to eq String
expect(password.cost).to equal(5)
expect(password.salt).to eql("$2a$05$CCCCCCCCCCCCCCCCCCCCC.")
expect(password.salt.class).to eq String
Expand Down