[erlang-questions] erlang:phash2(make_ref(), 1 bsl 32)

Per Melin <>
Thu May 8 02:47:37 CEST 2008


I thought that would be the easiest way to generate an integer unique enough
for my needs. But it seems to always repeat in 2^18 (262144) iterations.

That is because #Ref<_._.X.Y> gives the same phash2 as #Ref<_._.X+1.Y> in
any range between 2^20 and 2^32.

Isn't that a little unfortunate?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080508/d6607981/attachment.html>


More information about the erlang-questions mailing list