Robert Klemme
10/16/2008 10:59:00 AM
On 16.10.2008 10:26, Zangief Ief wrote:
> I would like to convert an input (like a file, or a password) into
> binary format. After reading my Ruby in a nutshell book, I belive I can
> use this method:
> unpack('C*')
This will give you an array of integer byte values. I am not sure where
there you see the binary format. What exactly do you want to achieve?
> So according the documentation, this is great for unsigned chars. But do
> the binary representation will respect the big endian convention?
What exactly do you mean by this? Are you referring to bits inside a
byte or to the ordering of multiple bytes? If the latter, there is no
point in talking about big or little endian when encoding byte wise
because there are not multiple bytes belonging together. If the former,
I am not sure whether there is any platform that reverses bits but it
could be possible. OTOH, how would you notice?
Kind regards
robert