From: Ron Green Date: 2007-09-10T04:23:43+09:00 Subject: Re: Hash Peter Cooper wrote: > On 9/9/07, Ron Green wrote: >> >> Marcel Molina Jr. wrote: >> > It should be noted though that String#hash isn't garaunteed to be >> > unique. >> >> Then,again I ask, what is it good for? > > > It's still useful as a hash. Marcel wasn't wrong, but *no* fixed size > hash > is "guaranteed" to be unique as that's absolutely impossible, per the > pigeonhole principle > (http://en.wikipedia.org/wiki/Pigeonhole_principle). > String#hash's hash is of a far lower "quality" than that offered by, > say, > SHA-1 or SHA-2. > > Regards, > Peter Cooper > http://www.rubyinside.com/ Peter, If Its not guaranteed to be unique, then it can't be used for identity. Can you give me an example of how i would use string.hash? -- Posted via http://www.ruby-forum.com/.