[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: BER versus ASCII (was: RE:)



On Thu, 6 Dec 2001, Michael Kirkham wrote:

> implementations are lazier than others.  All of the following are "legal"
> encodings if the integer value 1, for example:
>
> 02 01 01
> 02 84 00 00 00 01 01
> 02 84 00 00 00 04 00 00 00 01
>

A slight correction (thanks Randy for pointing it out): the third format
is not actually legal in BER, as it requires the value (but not the length
field) to be minimally encoded.  It is, however, an encoding you might see
from a "lazy" implementation that simply uses sizeof(variable) to
determine the length and stuffs the value into the encoding directly.