On Sat, 12 Jan 2013 19:04:00 +0000, Jaimie Vandenbergh wrote:
> [Default] On Sun, 13 Jan 2013 07:46:13 +1300, Ralph Fox
> <-rf-nz-@-.invalid> wrote:
>
> >As stated in the message, the table assumes all hash values
> >are equally likely. In fact message-IDs will use just over
> >50% of the range of hash values,
>
> What do you mean by that, Ralph? Signed int and negative aren't used?
No, it is not a contiguous range. For hash calculations like this,
the missing values are not going to be a contiguous range.
The table assumes there are 67,108,785 possible MID hash values in
the range -33554392..+33554392. In fact no more than 33,554,432
values in this range are possible MID hashes.
Agent's hash calculation for message-IDs includes the surrounding <>.
So the last character in a MID hash calculation is always going to
be '>', 0x3E.
If you look at the very last iteration of the hash calculation
h = ((h << 7) + key[j]) mod 0x01ffffd9
which takes the last character '>', 0x3E, and uses 32-bit arithmetic,
you will get this...
j.1 previous h up to 67,108,785 possible values
j.2 (h << 7) This is a 32-bit number where the least significant
7 bits are always zero. There are up to
2^(32-7) = 2^25 = 33,554,432 possible values.
j.3 (h << 7) + 0x3E The last character key[j] is always '>' 0x3E.
This is a 32-bit number where the least significant
7 bits are always 0x3E. There are up to
2^(32-7) = 2^25 = 33,554,432 possible values.
j.4 ((h << 7) + 0x3E) mod 0x01ffffd9
If there are 33,554,432 possible values for ((h << 7) + 0x3E)
then there can be no more than 33,554,432 possible values
for ((h << 7) + 0x3E) mod 0x01ffffd9
--
Kind regards
Ralph