
BER‑TLV/TLV parser for EMV payment data: recursive decode of constructed/primitive tags, hex-string I/O, comprehensive EMV tag dictionary, and rich value explainers and visualizations.
A cross-platform BER-TLV / TLV parser for EMV payment systems.
Parse, explain, and visualize EMV BER-TLV data on any platform — Web, Android, iOS, and JVM — from a single Kotlin Multiplatform core.
Universal BERTLV provides:
┌─────────────────────────────────────────────┐
│ Your App │
│ (Flutter / Kotlin) │
├─────────────────────────────────────────────┤
│ plugin/ — Flutter Plugin │
│ ┌─────────────┐ ┌──────────────────────┐ │
│ │ universal_bertlv │ │ Platform packages │ │
│ │ (interface) │ │ _web │ _mobile │ │
│ └─────────────┘ └──────────────────────┘ │
├─────────────────────────────────────────────┤
│ lib/ — Kotlin Multiplatform │
│ universal-bertlv (core) │
│ JS • JVM • Android • iOS (Native) │
└─────────────────────────────────────────────┘
| Layer | Path | Role |
|---|---|---|
| Core | lib/universal-bertlv |
KMP library — parser, tag registry, value explainers |
| Plugin interface | plugin/universal_bertlv |
Platform-agnostic Dart API (federated plugin) |
| Web impl | plugin/universal_bertlv_web |
dart:js_interop bridge to KMP JS output |
| Mobile impl | plugin/universal_bertlv_mobile |
dart:ffi bridge to Kotlin/Native |
The Flutter packages are not yet published to pub.dev. Consume a tagged source release and declare the app-facing package plus the required platform package:
dependencies:
universal_bertlv:
git:
url: https://github.com/rafaelrabeloit/universal-bertlv.git
ref: v0.0.10
path: plugin/universal_bertlv
universal_bertlv_web:
git:
url: https://github.com/rafaelrabeloit/universal-bertlv.git
ref: v0.0.10
path: plugin/universal_bertlv_webFor Android/iOS, replace universal_bertlv_web with universal_bertlv_mobile.
// build.gradle.kts
implementation("io.github.rafaelrabeloit:universal-bertlv:0.0.10")GitHub Packages is also available for snapshot builds — see lib/universal-bertlv/build.gradle.kts.
import 'package:universal_bertlv/universal_bertlv.dart';
final parser = BertlvEmv();
final result = await parser.parse('6F1A840E315041592E5359532E4444463031A5088801025F2D02656E');
for (final tag in result.tags) {
print('${tag.hexTag}: ${tag.name} = ${tag.hexValue}');
}Parse a TLV list from hex:
import io.github.rafaelrabeloit.bertlv.TLV
import io.github.rafaelrabeloit.bertlv.TLVList
import io.github.rafaelrabeloit.bertlv.TlvFindMode
import io.github.rafaelrabeloit.emv.EmvSpecification
val tlvList = TLVList.fromTlvListBuffer(
"6F1A840E315041592E5359532E4444463031A5088801025F2D02656E",
listOf(EmvSpecification),
)
tlvList.tlvs.forEach { println("${it.tag.toString(16).uppercase()}: ${it.hexValue}") }Parse or build a single TLV:
// Parse complete TLV from hex (spaces allowed)
val aid = TLV.fromBinaryTlvBuffer("9F06 07 A0000000031010")
println(aid.hexValue) // A0000000031010
// Build from tag + value hex
val built = TLV.fromTagAndBinaryValue(0x9F06, "A0000000031010")
// Find a tag inside a TLV list
val tvr = tlvList.find(0x95, TlvFindMode.FIRST)
val duplicateSensitive = tlvList.find(0x95, TlvFindMode.STRICT) // throws if duplicated| Platform | Mechanism |
|---|---|
| Web | Kotlin/JS → dart:js_interop
|
| Android | Kotlin/Native → dart:ffi
|
| iOS | Kotlin/Native → dart:ffi
|
| JVM | Direct Kotlin dependency |
A cross-platform BER-TLV / TLV parser for EMV payment systems.
Parse, explain, and visualize EMV BER-TLV data on any platform — Web, Android, iOS, and JVM — from a single Kotlin Multiplatform core.
Universal BERTLV provides:
┌─────────────────────────────────────────────┐
│ Your App │
│ (Flutter / Kotlin) │
├─────────────────────────────────────────────┤
│ plugin/ — Flutter Plugin │
│ ┌─────────────┐ ┌──────────────────────┐ │
│ │ universal_bertlv │ │ Platform packages │ │
│ │ (interface) │ │ _web │ _mobile │ │
│ └─────────────┘ └──────────────────────┘ │
├─────────────────────────────────────────────┤
│ lib/ — Kotlin Multiplatform │
│ universal-bertlv (core) │
│ JS • JVM • Android • iOS (Native) │
└─────────────────────────────────────────────┘
| Layer | Path | Role |
|---|---|---|
| Core | lib/universal-bertlv |
KMP library — parser, tag registry, value explainers |
| Plugin interface | plugin/universal_bertlv |
Platform-agnostic Dart API (federated plugin) |
| Web impl | plugin/universal_bertlv_web |
dart:js_interop bridge to KMP JS output |
| Mobile impl | plugin/universal_bertlv_mobile |
dart:ffi bridge to Kotlin/Native |
The Flutter packages are not yet published to pub.dev. Consume a tagged source release and declare the app-facing package plus the required platform package:
dependencies:
universal_bertlv:
git:
url: https://github.com/rafaelrabeloit/universal-bertlv.git
ref: v0.0.10
path: plugin/universal_bertlv
universal_bertlv_web:
git:
url: https://github.com/rafaelrabeloit/universal-bertlv.git
ref: v0.0.10
path: plugin/universal_bertlv_webFor Android/iOS, replace universal_bertlv_web with universal_bertlv_mobile.
// build.gradle.kts
implementation("io.github.rafaelrabeloit:universal-bertlv:0.0.10")GitHub Packages is also available for snapshot builds — see lib/universal-bertlv/build.gradle.kts.
import 'package:universal_bertlv/universal_bertlv.dart';
final parser = BertlvEmv();
final result = await parser.parse('6F1A840E315041592E5359532E4444463031A5088801025F2D02656E');
for (final tag in result.tags) {
print('${tag.hexTag}: ${tag.name} = ${tag.hexValue}');
}Parse a TLV list from hex:
import io.github.rafaelrabeloit.bertlv.TLV
import io.github.rafaelrabeloit.bertlv.TLVList
import io.github.rafaelrabeloit.bertlv.TlvFindMode
import io.github.rafaelrabeloit.emv.EmvSpecification
val tlvList = TLVList.fromTlvListBuffer(
"6F1A840E315041592E5359532E4444463031A5088801025F2D02656E",
listOf(EmvSpecification),
)
tlvList.tlvs.forEach { println("${it.tag.toString(16).uppercase()}: ${it.hexValue}") }Parse or build a single TLV:
// Parse complete TLV from hex (spaces allowed)
val aid = TLV.fromBinaryTlvBuffer("9F06 07 A0000000031010")
println(aid.hexValue) // A0000000031010
// Build from tag + value hex
val built = TLV.fromTagAndBinaryValue(0x9F06, "A0000000031010")
// Find a tag inside a TLV list
val tvr = tlvList.find(0x95, TlvFindMode.FIRST)
val duplicateSensitive = tlvList.find(0x95, TlvFindMode.STRICT) // throws if duplicated| Platform | Mechanism |
|---|---|
| Web | Kotlin/JS → dart:js_interop
|
| Android | Kotlin/Native → dart:ffi
|
| iOS | Kotlin/Native → dart:ffi
|
| JVM | Direct Kotlin dependency |