--o99acAvKqrTZeiCU
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Ken Bloom:

> There's nothing about hash codes that requires that
>   a.hash !=3D b.hash if a !=3D b
> You want to avoid collisions as much as possible, but that's an issue
> of performance, not correctness, so you'd be perfectly correct in
> adding up the hash codes of the members to create the has code.

True, but I do want to be able to key Hashes with my Blocks, so I do
want to avoid collisions as much as possible. I should=E2=80=99ve tested the
add-up-the-members=E2=80=99-hashes approach before/instead of crossing it o=
ut,
though.

> You may want to look at
> http://www.partow.net/programming/hashfunctions/
> which discusses some relatively important hash functions.
> You may have to experiment to see what works best. Wikipedia
> may also have good information.

Thanks for the pointers! I knew about hash functions before, I just
wasn=E2=80=99t sure whether there=E2=80=99s an idiomatic/popular/proper Rub=
y approach
to writing #hash.

-- Shot
--=20
I am a computer. I am dumber than any human and smarter than any administra=
tor.

--o99acAvKqrTZeiCU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFvvJui/mCfdEo8UoRAjggAJ9NilXow3gxAgv0/DhzdxEzHFsUcQCfSU1K
jjoYw6pf3C8ElJiMRsybwR8=
=FMI+
-----END PGP SIGNATURE-----

--o99acAvKqrTZeiCU--

Ken Bloom:

> There's nothing about hash codes that requires that
>   a.hash != b.hash if a != b
> You want to avoid collisions as much as possible, but that's an issue
> of performance, not correctness, so you'd be perfectly correct in
> adding up the hash codes of the members to create the has code.

True, but I do want to be able to key Hashes with my Blocks, so I do
want to avoid collisions as much as possible. I should°«ve tested the
add-up-the-members°«-hashes approach before/instead of crossing it out,
though.

> You may want to look at
> http://www.partow.net/programming/hashfunctions/
> which discusses some relatively important hash functions.
> You may have to experiment to see what works best. Wikipedia
> may also have good information.

Thanks for the pointers! I knew about hash functions before, I just
wasn°«t sure whether there°«s an idiomatic/popular/proper Ruby approach
to writing #hash.

-- Shot
-- 
I am a computer. I am dumber than any human and smarter than any administrator.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFvvJui/mCfdEo8UoRAjggAJ9NilXow3gxAgv0/DhzdxEzHFsUcQCfSU1K
jjoYw6pf3C8ElJiMRsybwR8=
=FMI+
-----END PGP SIGNATURE-----