Companion

object Companion

Builds an MRZ key from the fields as printed.

Functions

Link copied to clipboard

A key from a scanned or parsed MRZ, in one call: the document number, the date of birth and the date of expiry, each with its check digit, exactly as printed.

A key from a parse result, as a scanner returns it (MrzScanResult.Decoded.parse): the same as from on the document of a success or a partial success.

Link copied to clipboard
fun fromPrintedFields(documentNumberField: String, documentNumberCheckDigit: Char, optionalData: String, dateOfBirth: String, dateOfBirthCheckDigit: Char, dateOfExpiry: String, dateOfExpiryCheckDigit: Char): ChipAccessKey.Mrz

A key from the fields as printed in a TD1 or TD2 MRZ, where a document number longer than nine characters continues in the optional data.

Link copied to clipboard

A key from the result of normalizeTypedFields: the same as fromTypedFields called with its three values, so you do not unpack them by hand. Show the person the values (and NormalizedMrzFields.changedFields) and let them confirm, then pass the holder here.

fun fromTypedFields(documentNumber: String, dateOfBirth: String, dateOfExpiry: String): MrzKeyResult

A key from the three values as a person types them, with the check digits worked out by the SDK: the document number (up to nine characters or a longer complete number), the date of birth and the date of expiry (YYMMDD).

Link copied to clipboard
fun normalizeTypedFields(documentNumber: String, dateOfBirth: String, dateOfExpiry: String): NormalizedMrzFields

Cleans up the three values a person typed, in the two ways a keyboard makes likely, and reports what it changed. It is separate from fromTypedFields so that the person always sees the change: show NormalizedMrzFields.documentNumber, NormalizedMrzFields.dateOfBirth and NormalizedMrzFields.dateOfExpiry (and NormalizedMrzFields.changedFields) and let the person confirm, then pass them to fromTypedFields.