From: Gerry Ford Date: 2008-02-06T10:06:53+09:00 Subject: Re: hash value inconsistencies Tim Pease wrote: > On Feb 5, 2008, at 4:04 PM, Clifford Heath wrote: > >>> platforms? I'd like to have some method that I could call on an >>> object that would return a reproducible value that would uniquely >>> identify that object. >> >> That's not possible. There is more entropy in an arbitrary object than >> can be represented in a FixNum. Basic coding theory stuff. If it was >> possible, then you could code all the data in all the databases in the >> world into a single Fixnum :-). > > > Darn information theory! I just need a fixnum. The number of objects > we are creating is pretty tiny -- maybe 100. > > I was quite surprised that the Ruby "hash" method is not consistent > across platforms. The solution is to roll my own hash function that > produces consistent results. Just wondering about the more general > questions regarding the built in hash function. What in particular are you going to hash? Under what circumstances do you want to bomb out? -- -- Posted via http://www.ruby-forum.com/.