From: Victor Blaga Date: 2012-03-17T01:30:51+09:00 Subject: Converting Bignum into bytes --f46d040710ab53f77404bb5eb948 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I'm trying to convert a variable size BigNum into a variable length byte representation and I don't know if there exists a direct way. I'm thinking of Array#pack and String#unpack. Something similar to, for ex: big = 111111111111111111111111111111111111111 bytes = [big].pack("l*") and then big = bytes.unpack("l*") Regards, Victor --f46d040710ab53f77404bb5eb948 Content-Type: text/html; charset=ISO-8859-1 Hi all,

I'm trying to convert a variable size BigNum into a variable length byte representation and I don't know if there exists a direct way. I'm thinking of Array#pack and String#unpack.

Something similar to, for ex:
big = 111111111111111111111111111111111111111
bytes = [big].pack("l*")
and then
big = bytes.unpack("l*")

Regards,
Victor
--f46d040710ab53f77404bb5eb948--