$i = 1 + $hash % ($p-1)my $j = ( 1 + $i ) % ( 17 - 1 );
I'm not sure who you got those extra parens from, but they weren't from me. :)
Or, looking at it another way:
my $i=0;
The point of my suggestion, $i = 1 + $hash % ($p-1), is that it never results in $i == 0 (even if your computed $hash equals 0). So calling out the line that resulted from you doing $i=0 doesn't really have much bearing on the validity of my suggestion.
Does any of that help you see how you misinterpreted my suggestion? I ask because I'm not completely sure were the disconnect is and I'm reluctant to try guess at what I should try to explain.
- tye
In reply to Re^3: RFC: Is there a solution to the flaw in my hash mechanism? (p-1?)
by tye
in thread RFC: Is there a solution to the flaw in my hash mechanism? (And are there any others?)
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |