My apology, I had made a confusion between the length of the message and the length appended of it at its end... Now that's okay, many thanks :) I just have an ultimate question: Because I would like to work with an input in binary format, I would like to convert the message at the begining, before append the bit '1' on it. In this goal, can I convert the data in message with this: >> message = "A message" => "A message" >> message.unpack('b*').join => "100000100000010010110110101001101100111011001110100001101110011010100110" There is .unpack('B*') too, but with "B" the order is not correct I think. -- Posted via http://www.ruby-forum.com/.