From: "daniel åkerud" Date: 2008-06-10T17:37:38+09:00 Subject: To and from hex nibbles ------=_Part_13414_24078103.1213086996611 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I am converting to and from hex nibbles using the code below. Is there a smarter way for this? To hex nibbles: 'testing 123'.scan(/./).collect { |i| i.unpack('C')[0].to_s(16) }.join => "74657374696e6720313233" and back to binary: "74657374696e6720313233".scan(/../).collect { |i| i.to_i(16) }.pack('C*') => "testing 123" Thanks, /D ------=_Part_13414_24078103.1213086996611--