[107155] in North American Network Operators' Group
Re: interger to I P address
daemon@ATHENA.MIT.EDU (Johnny Eriksson)
Wed Aug 27 12:51:35 2008
Date: Wed, 27 Aug 2008 18:51:27 WET DST
From: Johnny Eriksson <bygg@cafax.se>
To: nanog@nanog.org
In-Reply-To: Your message of Wed, 27 Aug 2008 16:04:29 +0200
Errors-To: nanog-bounces@nanog.org
> Robert D. Scott wrote:
> > The harder way:
> >
> > Decimal: 1089055123
> > Hex (dashes inserted at octals): 40-E9-A9-93
> > Decimal (of each octet): 64-233-169-147
> > IP Address: 64.233.169.147
>
> The Python way
>
> >>> import socket, struct
> >>> socket.inet_ntoa(struct.pack('>l', 1089055123))
> '64.233.169.147'
The Tops-10/DDT way:
.r ddt
DDT
0! 1089055123.
lsh 4$x
<>
$10r$8o0/ 64.,233.,169.,147.,0. ^Z
.
--Johnny