<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I use crypto:sha(term_to_binary({make_ref(), now()}), then hexify it with the mochihex module from mochiweb, e.g.</div><div><br></div><div>>> mochihex:to_hex(crypto:sha(term_to_binary({make_ref(), now()}))).</div><div><div>"1477cfafb3ec026ab1c6c6ff0f0fb6c7ee001554"</div><div><br></div></div><div><br></div><div>- Andy</div><div><br></div><div><br></div><br><div><div>On May 8, 2008, at 7:02 AM, Per Melin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">2008/5/8 Darren New <<a href="mailto:dnew@san.rr.com">dnew@san.rr.com</a>>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d">I'm no expert, but my understanding is that make_ref() doesn't make a<br></div> particularly unique reference.</blockquote><br><br>You're right. But for what I need in this particular case it's perfect. It only has to be unique per node, and only a few million times. I could even use a counter, but then I'd have to have a process on each node just to own the counter.<br> <br>I'll use some combination of make_ref() and now() and it'll be fine. I just wonder if it isn't a weakness in how phash2 works with refs?<br><br></div> _______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions</a></blockquote></div><br></body></html>