This length will also vary dependant on whether the encoded integer is signed or unsigned.
regards, Sathya Narayanan S RPG Cellular Services Ltd. GSM : +91 98410 48051 > -----Original Message----- > From: Rajul Gupta [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, October 01, 2002 10:15 PM > To: [EMAIL PROTECTED] > Subject: Re: [ASN.1] BER: minimum number of bytes? > > > ----- Original Message ----- > From: "Sim. Ja." <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, October 01, 2002 12:16 PM > Subject: Re: [ASN.1] BER: minimum number of bytes? > > > > Ok, I thought it is trivial that I mean the value part. > > > > One byte for tag. One byte for length. > > And how many bytes for value? one or two? > > Minimum number of octets needed for the integer value. > > For example, if the value is 10, it MUST be encoded in one byte, and if it > is 500, then of course you need two bytes. > > Please check my second reply for the clarification of above. > > Thanks, > > Rajul > > > > > > > --- Rajul Gupta <[EMAIL PROTECTED]> schrieb: > > > > ----- Original Message ----- > > > From: "Sim. Ja." <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, October 01, 2002 9:16 AM > > > Subject: [ASN.1] BER: minimum number of bytes? > > > > > > > > > > Hi folk, > > > > > > > > I hope, you could confirm this statement. > > > > Given an element description as below > > > > cug-Index [17] IMPLICIT INTEGER ( 0 .. 32767 ) > > > OPTIONAL, > > > > > > > > if the value to be encoded is 0x0a, which needs only one byte in > BER, > > > > I must use one byte for a minimum encoding. > > > > > > I don't think you can encode above in one byte. You need three bytes > for > > > BER > > > (91 01 0A) and two for PER (00 0A). Also, your value range is between > 0 > > > and > > > 32767, which can't fit in one byte for all the possible values. > > > > > > Rajul > > > > > > > Thanks in advance > > > > Simin > > > > > > > > PS: The alternative is to see the space reserved for this value as > > > always > > > > two bytes. > > > > > > > > __________________________________________________________________ > > > > > > > > Gesendet von Yahoo! Mail - http://mail.yahoo.de > > > > M�chten Sie mit einem Gru� antworten? http://grusskarten.yahoo.de > > > > > > > > > > > > > > > __________________________________________________________________ > > > > Gesendet von Yahoo! Mail - http://mail.yahoo.de > > M�chten Sie mit einem Gru� antworten? http://grusskarten.yahoo.de > > > >
