From: Bertram Scharpf Date: 2009-12-18T00:49:04+09:00 Subject: Re: How to unpack an IP packed in little endian byte order Hi, Am Donnerstag, 17. Dez 2009, 22:57:30 +0900 schrieb Nicolas Vincent: > Here's an example : > BigNum stored in the database : 3232235797 > Resulting IP : 192.168.1.21 Here's one without using pack/unpack: ip = 3232235797 a = [] 4.times { a.unshift ip & 0xff ; ip >>= 8 } a.join "." #=> "192.168.1.21" Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany * Discover String#notempty? at .