Parsing TLV value in Python and print results

184 Views Asked by At

I I have a base64 string which I want to decode to its TLV origin then parse the TLV and pring data as regular strings:

import tlv8 ,base64

base64QR ="ASZNYWdpYyBGbG9vcmluZyBHZW5lcmFsIENvbnRyYWN0aW5nIEVzdAIPMzAwNjk2MjA4MTAwMDAzAxQyMDIzLTAyLTIwVDExOjI3OjU2WgQGNDAwLjY4BQU1Mi4yNg=="
rawByte = base64.b64decode(base64QR)

structure1 = {
1: tlv8.DataType.STRING,
2: tlv8.DataType.STRING,
3: tlv8.DataType.STRING,
4: tlv8.DataType.STRING,
5: tlv8.DataType.STRING
}

print( list(tlv8.decode(rawByte, structure1)))

However , when I print the result , I get memory address instead of real values - below is the output:

[<tlv8.Entry object at 0x00000243034EEFD0>, <tlv8.Entry object at 0x00000243034EF010>, <tlv8.Entry object at 0x00000243035A7210>, <tlv8.Entry object at 0x00000243035A72D0>, <tlv8.Entry object at 0x00000243035A7390>]

how can I get the values instead of memory address?

I have used base64 and TLV8 module Thanks

0

There are 0 best solutions below