On Sat, 2007-09-01 at 10:08 +0200, Peter J. Holzer wrote: > > > Better encode it binary. E.g. for IPv4: > > > > And better get the number of bits correct. An IP address is a 32 > bit > > integer, not 15 characters. > > You've snipped the context. JT was calling the > Qpsmtpd::Connection::local_ip method which does indeed return a string > of up to 15 characters, not an integer of 32 bits.
An IPv4 address is a 32 bit unsigned integer. The "string of 15 characters" is a human-readable representation of it. AFAICT the context was obtaining an efficient packing of the data in question (see the post on binary logging to a database). I chose the IP address as an example -- the ID being created was not even close to what we had been discussing and what Matt implemented and I did not want to go in to length on an example which appeared to be marginally on-topic. -- --gh