[erlang-questions] Warning: erlang:phash2 output

Martin Bjorklund mbj@REDACTED
Wed May 6 21:08:46 CEST 2009


Paulo Sérgio Almeida <psa@REDACTED> wrote:
> Hi all,
> This is a warning to whoever is using erlang:phash2.
> While considering the use of phash2 as a hash function (to use in a 
> bloom filter) as it is fast, I was horrified at its behaviour, specially 
> for atoms:

Actually, phash2 uses a great hash function (by Robert Jenkins), if
you know how to invoke it -- you need to call it with a binary to get
this algorithm.

1> erlang:phash2(<<"a">>).
2> erlang:phash2(<<"b">>).
3> erlang:phash2(<<"c">>).


More information about the erlang-questions mailing list