On Sun, Feb 25, 2007 at 09:04:44PM +0900, Mattias Bud wrote: > I'm parsing a binary file and it contains (reading the specs on the > format) uInt32Number, 4-byte/32-bit quantities. > > On the specific positions I read the value 0x000a - how do I turn this > into a 32-bit quantity? 0x00 0x0a is only 16 bits. Assuming you mean 0x00 0x00 0x00 0x0a: irb(main):001:0> s = "\x00\x00\x00\x0a" => "\000\000\000\n" irb(main):002:0> puts s.unpack("N")[0] 10 => nil