mrz

package
v0.0.0-...-5248474 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mrz provides utilities for parsing the 'Machine Readable Zone' (MRZ).

Index

Constants

View Source
const MRZLengthTD1 = 90
View Source
const MRZLengthTD2 = 72
View Source
const MRZLengthTD3 = 88

Variables

This section is empty.

Functions

func DecodeValue

func DecodeValue(value string) string

Types

type MRZ

type MRZ struct {
	DocumentCode   string
	IssuingState   string
	NameOfHolder   MrzName
	DocumentNumber string
	Nationality    string
	DateOfBirth    string
	Sex            string
	DateOfExpiry   string
	OptionalData   string
	OptionalData2  string // TODO - just required for TD1?.. should this be considered as a single logical field?
}

func MrzDecode

func MrzDecode(mrz string) (*MRZ, error)

func (*MRZ) EncodeMrzi

func (mrz *MRZ) EncodeMrzi() string

type MrzName

type MrzName struct {
	Primary   string
	Secondary string // optional
}

func ParseName

func ParseName(name string) MrzName

parses the name into primary and secondary (if present) components NB field separator is ' ' (double-space) as we've already converted '<' to ' ' earlier

Jump to

Keyboard shortcuts

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