From: Hee-Sob Park Date: 2001-07-28T10:53:07+09:00 Subject: [ruby-talk:18681] Re: Ruby equivalent of htons() and htonl() Hi, "Eric Crampton" wrote in message news:ilelr2dnfb.fsf@elmo.atdesk.com... > Is there any equivalent of the htons() and htonl() functions? Couldn't > find anything in the pick axe book. You can define functions like following def htonl(h) [h].pack("L").unpack("N")[0] end def htons(h) [h].pack("S").unpack("n")[0] end Park Hee-Sob.