On 5/23/05, Jim Freeze <jim / freeze.org> wrote: > * Brian Mitchell <binary42 / gmail.com> [2005-05-24 02:53:52 +0900]: > > > I have a number I must convert to a network long. I have been using > > this thus far with success: > > > > [number].pack("N") > > > > for 65 it should return "\000\000\000A". It does so on my linux boxes, > > an iMac with 10.3 but on my Powerbook with 10.4 it returns the reverse > > "A\000\000\000". What is causing this. Did Apple mess up yet again > > with including ruby? Could someone duplicate this on tiger? > > Hmm, What do your machines (specifically the iMac) return for this: > > BigEndian = (0 == [1].pack('l')[0]) PB(G4): true iMac(G5): true Linux(x86): false > LittleEndian = (1 == [1].pack('l')[0]) PB(G4): false iMac(G5): false Linux(x86): true Brian.