From: Matthew Kerwin Date: 2013-03-21T10:31:45+09:00 Subject: [ruby-core:53588] Re: Consistent hashing in the face of HashDOS? --f46d04426eda1d32a604d86533c8 Content-Type: text/plain; charset=ISO-8859-1 On 21 March 2013 10:50, Shota Fukumori (sora_h) wrote: > hi, > > On Thu, Mar 21, 2013 at 9:03 AM, Charles Oliver Nutter > wrote: > > My question for ruby-core: at what point did you decide to make hash > > for e.g. nil not be a single value (it was "4" in 1.8.7 and > > different/random in 1.9.3+), and why did you do it? > > Wait, `nil.id` returns NoMethodError, `nil.__id__` returns '4' (1.9.3) > or '8' (2.0.0+), > not a random value. > In 1.8, nil.hash => 4 In 1.9, nil.hash => random Fixnum, e.g. 192286870168610551 Ditto 2.0 -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/ --f46d04426eda1d32a604d86533c8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 1 March 2013 10:50, Shota Fukumori (sora_h) <sorah@tubusu.net> wrote:
hi,

On Thu, Mar 21, 2013 at 9:03 AM, Charles Oliver Nutter
<headius@headius.com> wrot= e:
> My question for ruby-core: at what point did you decide to make hash > for e.g. nil not be a single value (it was "4" in 1.8.7 and<= br> > different/random in 1.9.3+), and why did you do it?

Wait, `nil.id` return= s NoMethodError, `nil.__id__` returns '4' (1.9.3)
or '8' (2.0.0+),
not a random value.

In 1.8, nil.hash =3D> 4
In 1.9, = nil.hash =3D> random Fixnum, e.g. 192286870168610551
Ditto 2.0

--
=A0 Matthew Kerwin, B.Sc (CompSci) (Hons)=A0 http://ma= tthew.kerwin.net.au/
--f46d04426eda1d32a604d86533c8--