Wednesday, January 1, 2014

[ASN.1] BER TLV encoding length Length of notation obtain

Among ASN.1 BER encoding, Notation for studying, which
Picture schematic view showing the confused and keep the notation brought easy.


Sites cited in the quotation mark was placed at the bottom of the image.
Length of BER to represent the way in
 
 
 
Value from 0 to 127 bytes of data if the representation of one byte, which is referred to as Short Form.
 
 
Short Form i.e. the final bit is the most significant bit because it uses a sign bit, the eighth bit is to be zero.

If the 8th bit is 1, Long Form  proceeding, Long Form is

Therefore Length Short Form notation can be written in the most significant is the size of 127byte.
 127 is the hex '7F '
 
 
 
Short Form does not express in words the number of Value go beyond 127 bytes,

The eighth bit that separates the Short and Long Flag has become 1, Length is the length of the least significant bits shall be described.



Simply e.g.



If the value is 255 Value Length does not express type, because the Short, Flag is 1, and

Becomes consists of 0x81 0xFF.



If the value is 65536 if Value ... This is a Long Length

Become the 0x82 0xFFFF.



Easy and difficult to calculate the Length of the TLV difficult and easy way to do this is to clean up.

Whew ... 
 

No comments:

Post a Comment