Delphi TLV Encoding

409 Views Asked by At

I am trying to make a TLV Encoding format. I have managed to do the flowing:

TagValueLen := Length(TagValue);
TagBuf := IntToHex(TagNum,2);    // String
TagValueLenBuf := IntToHex(TagValueLen,2);   // String
TagValueBufArr := TEncoding.UTF8.GetBytes(TagValue);  // Tbyte Array

I think all I need now is to concat all 3 values to create the TLV, but how do I convert the hexadecimal strings (not exceeding 'ff') to one TBytes array?

0

There are 0 best solutions below