Explain every byte

Profile → outer hex decode → ASCII MTI → configured bitmap → fields → display.

The supplied schema has no LengthEncoding or MTIEncoding member. The profiles are synthetic, including the legacy VisaSpec name.

1 / 7

Work the cursor

Binary bitmap, fields 2,3,4:

MTI [0,4), bitmap [4,12), DE2 prefix [12,14), DE2 [14,30), DE3 [30,36), DE4 [36,48).

48 wire bytes = 96 outer hex characters.

2 / 7

Change one representation

Hex-ASCII bitmap takes 16 wire bytes rather than 8.

The same fields now start at 20; total = 56 bytes = 112 hex characters.

Choose the profile explicitly. Do not guess from printable bytes.

3 / 7

Length units

BCD 05 | 01 23 45: 2 ASCII prefix bytes + 3 payload bytes.

Decoded digits: 12345. Remove the leading zero pad, not the last digit. Reject signed lengths and invalid decimal nibbles.

4 / 7

First unknown boundary

DE3 lacks a specification: stop at byte 30.

Return completed DE2 plus a non-nil error. Never relabel DE3 bytes as DE4. Reject trailing data after one complete message.

5 / 7

One display policy

Text and JSON both redact sensitive raw hex and decoded values. Masked PAN + unmasked hex still reveals the PAN.

Amounts remain in minor units until a currency exponent is available.

6 / 7

Independent checks

  • Derive a fresh cursor table.
  • Explain incomplete parse versus valid transaction.
  • Search both displays for plaintext and hex disclosure.
  • Reconstruct the parser without copying a full solution.
7 / 7
←/→ or click edges to navigate · ? help · N notes · F fullscreen