On Oct 24, 2006, at 4:40 PM, Tim P. wrote:
Does ruby provide a global or a method call to determine the endianess
of the underlying platform?
This is what I cooked up, but I’m wondering if there is a ruby way of
BIG_ENDIAN = [0xFF00].pack(‘S’) == [0xFF00].pack(‘n’)
Beware, some versions of ruby shipped with OS X have a broken pack
where the endianness is swapped.
Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant