Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.programming,comp.unix.programmer Subject: Re: hash function over IP address Date: Fri, 06 Apr 2012 17:21:42 +0100 Lines: 16 Message-ID: <87aa2og7ah.fsf@sapphire.mobileactivedefense.com> References: <87bon65l7n.fsf@sapphire.mobileactivedefense.com> <87ehs0g7nn.fsf@sapphire.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net zCNO156VhvlZoc9PyPbxOgfDJODrdJ96hGKw12P/577rpENfo= Cancel-Lock: sha1:0yVWyfOD6SXt3GMsrihIhLxLOB8= sha1:HxY2/pozK1e2s1Aosxkq2YwPr+8= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: csiph.com comp.programming:1445 comp.unix.programmer:2386 Rainer Weikusat writes: > "Mark" writes: [...] >> How would you suggest to concatenate 32-bit long unsigned >> integers, in what form -- convert to strings, concatenate and use such >> string as a key? > > I would consolidate each pair into a 64-bit integer, using 0 in place > of a possibly-missing 'second 32-bit number' and then do 'string > comparions' on 64-bit integer strings of some length. Clarification: This is not supposed to refer to the C str*-library functions but to equivalent algorithms working with 64-bit integers instead of chars.