title: How to create and parse Tag, Length, Value (TLV) in JavaScript or java and encode it in Base64
body: <p>The QR code fields shall be encoded in Tag-Length-Value (TLV) format with the tag values specified in the “Tag” column of the adjacent table in the image below.</p>
  <p>The TLV encoding shall be as follows:</p>
  <p>Tag: the tag value as mentioned above is stored in one byte
  Length: the length of the byte array resulted from the UTF8 encoding of the field value. The length shall be stored in one byte.
  Value: the byte array resulting from the UTF8 encoding of the field value.</p>
  <p>This image describe my problem:</p>
  <p><img src="https://i.stack.imgur.com/PZ2d9.jpg" alt="" /></p>