CrystalIso8583::Shared::Codec::Configurable
Inherits CrystalIso8583::Shared::Codec < Reference < Object
Configurable codec — independently selects the wire encoding used for the MTI, variable-length prefixes, numeric (N) field data, and alphanumeric (AN/ANS) field data. Useful for real-world networks (e.g. VisaNet BASE I) that mix encodings: BCD-packed MTI and numeric fields, raw binary length prefixes, and EBCDIC text fields.
Binary (B) field data is always treated as raw bytes, matching the
other codecs. Binary length prefixes use a fixed byte width
(binary_length_byte_size, default 1) for both LLVAR and LLLVAR
fields, since real networks typically use a single byte for both
rather than scaling the prefix width with the nominal digit count.
Track 2 (Z) field data follows numeric_encoding when it's BCD — packed via the Track 2 nibble mapping (digits, '=' separator, 'F' pad nibble) rather than plain digit BCD — since real networks BCD-pack Track 2 the same way they BCD-pack numeric fields. Otherwise it falls back to text_encoding, same as AN/ANS.
Constructors
Instance methods
Decode raw field bytes into a String.
length is the logical field length (number of characters/digits), not the byte count.
Binary fields (DataType::B) are returned as lowercase hex strings.
Encode a field value string using the codec rules for the given data type.
Number of wire bytes occupied by length field-units of data_type.
Number of bytes used by a variable-length prefix with digits digit positions.