On Wed, 2007-08-29 at 19:15 -0400, Guy Hulbert wrote:
[snip]
> And better get the number of bits correct.  An IP address is a 32 bit
> integer, not 15 characters.  Although perl converts scalars on-demand,

I should have said 'unsigned'.

[snip]
> IPv-agnostic.  At this point we are at 128 bits (8 bytes) - same as
> UUID.

[EMAIL PROTECTED]:~$ ./quid
46d604d6-000827f7-4adc-00000000-c0a80005

------- 'quid' = qpsmtpd uid -----
#!/usr/bin/perl -w

use strict;
use Time::HiRes qw( gettimeofday );
use Socket;
use vars qw ( $rcpt $iaddr $me );
$me='cal';
$iaddr = unpack('N',((gethostbyname($me))[4]));
$rcpt = 0;
print sprintf("%08x-%08x-%04x-%08x-%08x\n",gettimeofday,$$,$rcpt,$iaddr);
----------------------------------

Requirements
 1. Unique transaction ID (gettimeofday, $$)
 2. RCPT counter ($rcpt)
 3. Multiple hosts ($iaddr)
 4. Format (e.g. %0#x-)

[snip]
-- 
--gh


Reply via email to