[erlang-questions] Warning: erlang:phash2 output

Antoine Koener <>
Tue May 12 12:14:12 CEST 2009


FYI

There's some new hashing functions out there:
see

http://murmurhash.googlepages.com/

Highlights from the page:

*Extremely simple* - compiles down to ~52 instructions on x86.

*Excellent distribution* - Passes chi-squared tests for practically all
keysets & bucket sizes.

*Excellent avalanche behavior* - Maximum bias is under 0.5%.
*Excellent collision resistance* - Passes Bob Jenkin's frog.c torture-test.
No collisions possible for 4-byte keys, no small (1- to 7-bit)
differentials.

May be one day phash2 will use this one :)

2009/5/7 Paulo Sérgio Almeida <>

>
> Bjorn Gustavsson wrote:
>
> > Actually, it produces good hash values for any term *except* atoms.
>
> More good news. Now I can avoid doing a term_to_binary, and get around
> twice the speed for common small terms.
>
> Thanks Bjorn,
> /psa
>
> >
> > If you have term that contains atoms (e.g. atoms in a list or tuple), you
> > will probably get a decent hash value anyway because the hash for
> > the atoms is mixed into the hash value calculated by the list or the
> > tuple.
> >
> > Try:
> >
> > erlang:phash2([a]).
> > erlang:phash2([b]).
> > erlang:phash2([c]).
> >
> > /Bjorn
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 

http://easyerl.blogspot.com/
http://www.open-tools.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090512/a700b991/attachment.html>


More information about the erlang-questions mailing list