formats

package
v0.0.0-...-96cec2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher interface {
	Encrypt(plainText []byte) ([]byte, error)
	Decrypt(cipherText []byte) ([]byte, error)
}

type Format

type Format interface {
	SetDebugWriter(writer io.Writer)
	Encode(pin, account string) (string, error)
	Decode(pinBlock, account string) (string, error)
}

func NewANSIX98

func NewANSIX98() Format

ANSI X9.8:

Same as ISO-0.

func NewECI1

func NewECI1() Format

ECI-1

Same as ISO-0.

func NewECI2

func NewECI2() Format

ECI-2

func NewECI3

func NewECI3() Format

ECI-3

func NewECI4

func NewECI4() Format

ECI-4

Same as ISO-1.

func NewFormatter

func NewFormatter(bType string) (Format, error)

func NewISO0

func NewISO0() Format

func NewISO1

func NewISO1() Format

func NewISO2

func NewISO2() Format

The ISO-2 PIN Block format is used for smart card offline authentication. It is similar to an ISO-1 PIN Block in that there is no PAN to associate with the PIN. It differs in that the fill is 0xF instead of random digits

func NewISO3

func NewISO3() Format

ISO 9564-1: 2002 Format 3.

Format 3 is the same as format 0, except that the “fill” digits are random values from 10 to 15,
and the first nibble (which identifies the block format) has the value 3.

func NewISO4

func NewISO4(cipher Cipher) Format

func NewOEM1

func NewOEM1() Format

OEM-1 / Diebold / Docutel / NCR

The OEM-1 PIN block format is equivalent to the PIN block formats that Diebold, Docutel, and NCR define.
The OEM-1 PIN block format supports a PIN from 4 to 12 digits in length.
A PIN that is longer than 12 digits is truncated on the right.

func NewVISA1

func NewVISA1() Format

VISA-1

Same as ISO-0.

func NewVISA2

func NewVISA2() Format

VISA-2

func NewVISA3

func NewVISA3() Format

VISA-3

func NewVISA4

func NewVISA4() Format

VISA-4

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL