From: Sam Roberts Date: 2003-06-02T09:48:34+09:00 Subject: Re: What is BER compression? (was RCR: unpack/pack Bignum) Quoteing matz@ruby-lang.org, on Mon, Jun 02, 2003 at 02:34:41AM +0900: > |Is it documented anywhere, what this 'w' template is useful for? > > Ask Perl people, it's there only for Perl pack compatibility. Well, I can't find any reference to its usefulness in Perl, and I don't think Larry would have the time to explain it to me. I can't find it documented in the Pickaxe, or rubycentral.com/ref/. When it is documented, I sugest NOT copy and pasting the Perl documentation, its wrong. And don't call it "compressed", it's anti-compressed... How about: 'w' A variable-length binary encoding of an unsigned integer of any size. Its format is a sequence of one or more bytes, each of which provides seven bits of the total value, with the most significant first. Bit eight of each byte is set, except for the last byte, in which bit eight is clear. In case anybody is interested, the format is similar to that defined in X.690 (ASN.1's BER encoding), section 8.20 "Encoding of a relative object identifier value" (I can't attach the page in pdf, the mailing list bounced it back to me, but you can google it in seconds). I didn't know Perl compatibility was important enough to add stuff like this! I'm mystified. It sounds like 'w' could be used to actually do something useful, instead of this! Cheers, Sam