iso8583sim.wire converts between the two.
iso8583sim.wire.encode_message and decode_message.
Presets
WireFormat.preset("bcd") looks a preset up by name.
Custom formats
Every part is configurable:- BCD packs two digits per byte. An LLVAR BCD length is one byte, an LLLVAR length two bytes. The length counts digits, not bytes.
- Odd digit counts need a filler nibble. Fixed numeric fields always get a leading
0. For variable fields, networks differ, sobcd_odd_paddingchooses a leading0or a trailingF. - Track 2 (field 35) uses
=as a separator, which BCD writes as the nibbleD. - Content types. Fields 2, 32, 33, 99 and 100 are numeric, fields 35 and 36 are track data, and field 55 (EMV) is binary. Other variable fields are text.