Actions
Bug #4104
closedString#hash should return different value for different string.
Description
=begin
On Ruby 1.9.x, String#hash returns same value for any "\x00" trailing string.
C:\work>irb
irb(main):001:0> "a".hash
=> -242103097
irb(main):002:0> "a\x00".hash
=> -242103097
irb(main):003:0> "a\x00\x00".hash
=> -242103097
On Ruby 1.8.6, String#hash returns different value for different string.
C:\work>irb
irb(main):001:0> "a".hash
=> 100
irb(main):002:0> "a\x00".hash
=> 6561949
irb(main):003:0> "a\x00\x00".hash
=> 826408672
I think that String#hash should return different value for different string.
=end
Updated by nobu (Nobuyoshi Nakada) almost 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r29991.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Actions
Like0
Like0