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?
--- 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
