Documentation ¶
Index ¶
- Constants
- Variables
- func DecA(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecAN(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecANS(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecB(_ Hasher, _ Codec, enc []byte) ([]byte, error)
- func DecBitmap(_ Hasher, _ Codec, enc []byte) ([]byte, error)
- func DecFirstPANTruncate(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecHash256(h Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecN(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecNS(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecNullify(_ Hasher, _ Codec, _ []byte) ([]byte, error)
- func DecPANTruncate(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecTSYSBitmap64R(_ Hasher, _ Codec, data []byte) ([]byte, error)
- func DecXN(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecZ(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func DecodeEbcdic(src []byte) ([]byte, error)
- func DecodeMTI(_ Hasher, codec Codec, enc []byte) ([]byte, error)
- func EncA(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncAN(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncANS(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncB(_ Hasher, _ Codec, dec []byte) ([]byte, error)
- func EncBitmap(_ Hasher, _ Codec, dec []byte) ([]byte, error)
- func EncN(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncNS(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncTSYSBitmap64R(_ Hasher, _ Codec, data []byte) ([]byte, error)
- func EncXN(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncZ(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func EncodeEbcdic(src []byte) ([]byte, error)
- func EncodeMTI(_ Hasher, codec Codec, dec []byte) ([]byte, error)
- func NewHashify() hashify
- func NewMarshaler(f Format) marshal
- func NewUnmarshaler(f Format) unmarshal
- type Charset
- type Codec
- type DecodeCharsetFunc
- type DecodeFunc
- type EncodeCharsetFunc
- type EncodeFunc
- type FIX
- type Format
- type Hasher
- type LLLVAR
- type LLVAR
- type LVAR
- type Marshaler
- type Unmarshaler
Constants ¶
const Tag8583 = "iso8583"
Variables ¶
var ( // ASCII encodes/decodes ASCII charset of the ISO 8583 MTI/bitmaps/fields. ASCII = NOPCharset // EBCDIC encodes/decodes EBCDIC charset of the ISO 8583 MTI/bitmaps/fields. EBCDIC = Charset{EncodeEbcdic, DecodeEbcdic} // NOPCharset is a "no operation" charset encoder/decoder. NOPCharset = Charset{} )
var ( // MTIAsciiCodec encodes/decodes ISO 8583 MTI (Message Type Indicator) // the size of which is 4 bytes in ASCII character encoding. MTIAsciiCodec = FIX{4, ASCII, EncodeMTI, DecodeMTI} // MTIEbcdicCodec encodes/decodes ISO 8583 MTI (Message Type Indicator) // the size of which is 4 bytes in EBCDIC character encoding. MTIEbcdicCodec = FIX{4, EBCDIC, EncodeMTI, DecodeMTI} // BitmapCodec encodes/decodes ISO 8583 bitmap the size of which is 8 bytes (64 bit). BitmapCodec = FIX{8, NOPCharset, EncBitmap, DecBitmap} )
var ( MastercardMarshaler = NewMarshaler(Mastercard) MastercardUnmarshaler = NewUnmarshaler(Mastercard) // MastercardTruncate decoder and truncator (masker) of the decoded ISO 8583 message. MastercardTruncate = make(Format) MastercardUnmarshalerTruncator Unmarshaler // MastercardHash256 decoder and hasher (obfuscatator) of the ISO 8583 message. MastercardHash256 = make(Format) MastercardUnmarshalerHasher256 Unmarshaler // MastercardHashed256 coder/decoder of the ISO 8583 obfuscatated message. MastercardHashed256 = make(Format) MastercardHashed256Marshaler Marshaler MastercardHashed256Unmarshaler Unmarshaler )
var ( TSYSMarshaler = NewMarshaler(TSYS) TSYSUnmarshaler = NewUnmarshaler(TSYS) )
var Mastercard = Format{}/* 130 elements not displayed */
Mastercard is a format of the ISO 8583 message which maps the codecs to MIT/bitmaps/each individual field.
var TSYS = Format{}/* 130 elements not displayed */
TSYS is a format of the ISO 8583 message which maps the codecs to MIT/bitmaps/each individual field.
Functions ¶
func DecA ¶
DecA intends to decode Alpha, including blanks <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecAN ¶
DecAN intends to decode alphanumeric <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecANS ¶
DecANS intends to decode alphabetic, numeric and special characters <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecB ¶
DecB intends to decode binary data <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecFirstPANTruncate ¶
DecFirstPANTruncate intends to decode and truncate (mask) PAN located at the beginning of the byte slice, 1234567890123456D99122011969100000377 -> 1234XXXXXXXX3456D99122011969100000377
func DecHash256 ¶
DecHash256 intends to decode and hash (obfuscate) like Central Bank of the Russian Federation obfuscates PAN, using the SHA 256 sum function.
func DecN ¶
DecN intends to decode numeric values only <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecNS ¶
DecNS intends to decode numeric and special characters only <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecNullify ¶
DecNullify just skips the field.
func DecPANTruncate ¶
DecPANTruncate intends to decode and truncate (mask) PAN, 1234567890123456 -> 1234XXXXXXXX3456.
func DecTSYSBitmap64R ¶
DecTSYSBitmap64R intends to decode TSYS specific bitmap the size of which is 8 bytes (64 bit) plus one additional optional byte for the "R" flag.
func DecXN ¶
DecXN intends to decode numeric (amount) values, where the first byte is either 'C' to indicate a positive or Credit value, or 'D' to indicate a negative or Debit value, followed by the numeric value (using n digits) <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func DecZ ¶
DecZ intends to decode tracks 2 and 3 code set as defined in ISO/IEC 7813 and ISO/IEC 4909 respectively <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>, <https://en.wikipedia.org/wiki/ISO/IEC_7813>.
func DecodeEbcdic ¶
DecodeEbcdic intends to decode all bytes in EBCDIC character encoding except the null character.
func EncA ¶
EncA intends to encode Alpha, including blanks <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncAN ¶
EncAN intends to encode alphanumeric <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncANS ¶
EncANS intends to encode alphabetic, numeric and special characters <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncB ¶
EncB intends to encode binary data <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncN ¶
EncN intends to encode numeric values only <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncNS ¶
EncNS intends to encode numeric and special characters only <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncTSYSBitmap64R ¶
EncTSYSBitmap64R intends to encode TSYS specific bitmap the size of which is 8 bytes (64 bit) plus one additional optional byte for the "R" flag.
func EncXN ¶
EncXN intends to encode numeric (amount) values, where the first byte is either 'C' to indicate a positive or Credit value, or 'D' to indicate a negative or Debit value, followed by the numeric value (using n digits) <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>.
func EncZ ¶
EncZ intends to encode tracks 2 and 3 code set as defined in ISO/IEC 7813 and ISO/IEC 4909 respectively <https://en.wikipedia.org/wiki/ISO_8583#Data_elements>, <https://en.wikipedia.org/wiki/ISO/IEC_7813>.
func EncodeEbcdic ¶
EncodeEbcdic intends to encode all bytes in EBCDIC character encoding except the null character.
func NewHashify ¶
func NewHashify() hashify
func NewMarshaler ¶
func NewMarshaler(f Format) marshal
func NewUnmarshaler ¶
func NewUnmarshaler(f Format) unmarshal
Types ¶
type Charset ¶
type Charset struct { Enc EncodeCharsetFunc Dec DecodeCharsetFunc }
Charset encodes/decodes charset of the ISO 8583 MTI/bitmaps/fields.
type Codec ¶
type Codec interface { Encode(Hasher, []byte) ([]byte, error) Decode(Hasher, []byte) ([]byte, error) Read(io.Reader) ([]byte, error) Write(io.Writer, []byte) error Len() int Charset() Charset }
Codec encodes/decodes a MTI/bitmaps/fields of the ISO 8583 message.
type DecodeCharsetFunc ¶
DecodeCharsetFunc decodes charset of the ISO 8583 MTI/bitmaps/fields.
type DecodeFunc ¶
DecodeFunc decodes ISO 8583 MTI/bitmaps/fields.
type EncodeCharsetFunc ¶
EncodeCharsetFunc encodes charset of the ISO 8583 MTI/bitmaps/fields.
type EncodeFunc ¶
EncodeFunc encodes ISO 8583 MTI/bitmaps/fields.
type FIX ¶
type FIX struct { Length int ChrSet Charset Enc EncodeFunc Dec DecodeFunc }
FIX is an codec for a fixed length fields/MTI/bitmaps of the ISO 8583.
type LLLVAR ¶
type LLLVAR struct { MaxLen int ChrSet Charset Enc EncodeFunc Dec DecodeFunc }
LLLVAR is an codec for the variable length fields of the ISO 8583, the length coded in 3 bytes.
type LLVAR ¶
type LLVAR struct { MaxLen int ChrSet Charset Enc EncodeFunc Dec DecodeFunc }
LLVAR is an codec for the variable length fields of the ISO 8583, the length coded in 2 bytes.
type LVAR ¶
type LVAR struct { MaxLen int ChrSet Charset Enc EncodeFunc Dec DecodeFunc }
LVAR is an codec for the variable length fields of the ISO 8583, the length coded in 1 byte.