Thank you all for your help.

So if I have well understood, is that correct if I use unpack('N*') like 
this?

>> message = "A message"
=> "A message"
>> message.unpack('N*').join.to_i.to_s(2)
=> "1001011110100010100001010001010100101100001110000101010101100111"
-- 
Posted via http://www.ruby-forum.com/.