From: nobu.nokada@... Date: 2003-05-29T19:02:06+09:00 Subject: Re: RCR: unpack/pack Bignum Hi, At Thu, 29 May 2003 14:52:59 +0900, Robert Feldt wrote: > > I guess Bignum (un)packing would be used for external data > > exchange, so it'd be better to provide each singned/unsigned > > and big/little endian conversion, like as 'l', 'L' and so on. > > But 'w' is used already. > > > Hm, I've envisioned Bignum (un)packing for cryptographic applications > where nonnegative num <-> MSB-first string is all there is, but maybe > you're right. But there are very many combinations (signed/unsigned, > big/little endian for full string and for groups of 2/4 bytes etc). Which > ones should be supported? Sorry, there's no combination of signedness and endianness, 'N', 'n', 'V', 'v' are always unsigned. Rather, what about size specifier extends generic integer conversion? [10].pack("i(8)") => "\0\0\0\0\0\0\0\012" # big endian => "\012\0\0\0\0\0\0\0" # little endian > What is 'w' used for? I had missed that one. BER (Basic Encoding Rules) compression. At Thu, 29 May 2003 18:01:41 +0900, Robert Feldt wrote: > Maybe I'm mixing different things here, maybe better to have this a a > method on Numeric? Numeric#to_raw_string and Numeric.from_raw_string(str)? It would be nice, but perhaps needs better name. -- Nobu Nakada