class

CrystalIso8583::Shared::Codec::BCD

Inherits CrystalIso8583::Shared::Codec < Reference < Object


BCD codec — MTI and numeric fields as packed Binary Coded Decimal; alphanumeric/binary fields remain as raw ASCII bytes.

Instance methods

decode_field(bytes : Bytes, data_type : DataType, length : Int32) : String

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.

Source
decode_length(bytes : Bytes, digits : Int32) : Int32
Source
decode_mti(bytes : Bytes) : MTI
Source
decode_string(bytes : Bytes) : String
Source
encode_field(str : String, data_type : DataType) : Bytes

Encode a field value string using the codec rules for the given data type.

Source
encode_length(length : Int32, digits : Int32) : Bytes
Source
encode_mti(mti : MTI) : Bytes
Source
encode_string(str : String) : Bytes
Source
field_byte_size(length : Int32, data_type : DataType) : Int32

Number of wire bytes occupied by length field-units of data_type.

Source
length_byte_size(digits : Int32) : Int32

Number of bytes used by a variable-length prefix with digits digit positions.

Source
mti_byte_size

Number of bytes used by the MTI in this codec.

Source