String#unpack and big-endian versus little-endian

Unless I’ve missed something, what about byte.reverse!

Regards,

Dan

···

-----Original Message-----
From: Harry Ohlsen [mailto:harryo@zip.com.au]

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.

Yes, there’s another “working on 3 hours’ sleep” problem :slight_smile: !!

···

On Thu, 9 Jan 2003 07:51, Berger, Daniel wrote:

-----Original Message-----
From: Harry Ohlsen [mailto:harryo@zip.com.au]

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.

Unless I’ve missed something, what about byte.reverse!