Hi Paul,

> Not necessarily better. Depends on the variety of IP addresses you're
> expecting, for example are they all likely to be in one of the 'local'
> ranges? (10.0.0.1 .. 10.255.255.254, 172.16.0.1 .. 172.31.255.254 or
> 192.168.0.1 .. 192.168.255.254) or global?

Unfortunately, global.

> return (ipaddress &0xff) ^
> ((ipaddress >> 8) &0xff) ^
> ((ipaddress >> 16) &0xff) ^
> ((ipaddress >> 24) &0xff); /* XOR all
> bytes of address - again, 0-255*/

I have seen this particular hash algo a couple of times. Any reason/stats
with which we can claim that this is better than the one that i suggested?
Or scenarios, where this particular algorithm would prove to be more
efficient in terms of hash collisions.

Regards,
Sylvia

>
> srand(ipaddress);
> return rand() / (RAND_MAX / 256 + 1); /* plain weird */
>
>
> --
> PJH
>
> "Consistently separating words by spaces became a general custom about
> the tenth century A.D., and lasted until about 1957, when FORTRAN
> abandoned the practice." -- Sun FORTRAN Reference Manual
>
>
>
> Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire,
GL12 8JD, UK
> Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272
>
> Website : www.alderley.com  Sales : [EMAIL PROTECTED] Service :
[EMAIL PROTECTED]
>
> This email and its contents are confidential and are solely for the use of
the intended recipient. If you are not the original recipient you have
received it in error and any use, dissemination, forwarding, printing or
copying of this email is strictly prohibited. Should you receive this email
in error please immediately notify [EMAIL PROTECTED]
>
> This email has been scanned for viruses, however you should always scan
emails with your own systems prior to opening.
>
>
>
>
>
>
>
> To unsubscribe, send a blank message to
<mailto:[EMAIL PROTECTED]>.
> Yahoo! Groups Links
>
>
>
>
>
>
>



To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5526708.6599542.3001176/D=groups/S=:HM/A=2372354/rand=522382250


Yahoo! Groups Links

Reply via email to