From: Matt Armstrong Date: 2003-01-09T05:47:51+09:00 Subject: Re: String#unpack and big-endian versus little-endian Harry Ohlsen writes: > I ended up with code like ... > > byte[0], byte[1], byte[2], byte[3] = > byte[3], byte[2], byte[1], byte[0] > > I can't help but wonder whether there's a cleverer way to do this. > I couldn't see anything in unpack() that allowed for specifying the > endian-ness See http://www.rubycentral.com/book/ref_c_string.html#String.unpack. In particular, 'V' and 'N' may do what you want.