BerTlv.NET is a library that makes parsing TLV data easy. It is especially useful for parsing things like EMV credit card transaction data.
You can install BerTlv.NET from nuget:
PM> Install-Package BerTlv.NET
Or download and build the source from here and reference the BerTlv.dll.
Using BerTlv.NET is very simple. Two static methods are exposed to you in the
Tlv class (one for hex and one for a byte array). Example:
First add the using statement:
using BerTlv;then:
ICollection<Tlv> tlvs = Tlv.ParseTlv("6F1A840E315041592E5359532E4444463031A5088801025F2D02656E");
// Use the tlvs collection now.Fixes issue with parsing of null bytes (0x00) before, between, or after a valid tag
Add netstandard2.0 support.
Add back net45 support.
Change project to use netstandard1.1.
Renamed Tlv.DataHex property to Tlv.HexData to be consistent with the naming convention of the rest of the Tlv.Hex* properties.
Initial release.