You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Pasha Bizhan <lu...@lucenedotnet.com> on 2005/12/23 12:01:59 UTC

LUCENE-460

Hi,

Question about latest cvs changes and hashcodes.
http://issues.apache.org/jira/browse/LUCENE-460

Could anybody explain the magic numbers? 0x6634D93C,0x2742E74A and other.
Any special meaning? Is this documented anywhere?

Pasha 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: LUCENE-460

Posted by Yonik Seeley <ys...@gmail.com>.
Here is my previous reply to Otis:

> python -c "import random;print hex(random.getrandbits(32))[:-1]"
> Just a way of making some things unique.... let me know if you have a
> better idea on that.

So those constants are just random numbers.  I thought about trying to
pick magic numbers to maximize hamming distances, etc, but it's more
work and more likely to mess things up if you get it wrong. 
getClass().hashCode() would also work, but it would be slower.

I'll add this explanation to the bug.

-Yonik

On 12/23/05, Pasha Bizhan <lu...@lucenedotnet.com> wrote:
> Hi,
>
> Question about latest cvs changes and hashcodes.
> http://issues.apache.org/jira/browse/LUCENE-460
>
> Could anybody explain the magic numbers? 0x6634D93C,0x2742E74A and other.
> Any special meaning? Is this documented anywhere?
>
> Pasha
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org