Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So the grammar for this Tag Node is:

Code Block
languagexml
<Tag name="tagValue" type="BERTag" discriminator="5" tagType="Context" berConstruct="T"/>


If the tag is specified as more than one byte, e.g. BF3B or 48955, then the actual tag value is greater than or equal to 31 (5 bits are not enough to encode values greater than 31; and the binary value for 31 is reserved, as described below). The remaining 5 bits on the first byte are all set to 1 indicating that the actual tag value is stored in the following bytes. To determine the actual tag value:

...

For example, a tag specified as BF3B in hex or 48955 in decimal converts to binary as:

Code Block
languagexml
10111111 00111011


The top three bits indicate that the tagType is Context and berConstruct is T. The next 5 bits indicate that the tag value is greater than or equal to 31, and is encoded in subsequent bytes. The top bit of the next byte is 0, which indicates that this byte contains the whole tag value. The remaining 7 bits evaluate to the decimal value 59. The grammar for this tag is:

Code Block
languagexml
<Tag name="tagValue" type="BERTag" discriminator="59" tagType="Context" berConstruct="T"/>