.. index:: 
  !MrzHelper.check Method
  
.. _id3_document_mrz_helper_check_class_method:

===============================================================================
MrzHelper.check Method
===============================================================================

Module: :ref:`MrzHelper<id3_document_mrz_helper_class>`

Definition
----------

Checks the validity of a single line of an MRZ of a given type by checking the check digits.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        check(text: str, type: MrzType) -> bool

      **Parameters**

        .. line-block::

          ``text`` str
          :guilabel:`in` The input MRZ line.

          ``type`` :ref:`MrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.


      **Returns**

        .. line-block::

          ``bool``
          The result of the verification.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static bool check(String? text, MrzType type)

      **Parameters**

        .. line-block::

          ``text`` String
          :guilabel:`in` The input MRZ line.

          ``type`` :ref:`MrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.


      **Returns**

        .. line-block::

          ``bool``
          The result of the verification.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static bool Check(string text, MrzType type)

      **Parameters**

        .. line-block::

          ``text`` string
          :guilabel:`in` The input MRZ line.

          ``type`` :ref:`MrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.


      **Returns**

        .. line-block::

          ``bool``
          The result of the verification.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static boolean check(String text, MrzType type) throws DocumentException

      **Parameters**

        .. line-block::

          ``text`` String
          :guilabel:`in` The input MRZ line.

          ``type`` :ref:`MrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.


      **Returns**

        .. line-block::

          ``boolean``
          The result of the verification.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func check(text: String, type: MrzType) throws -> Bool

      **Parameters**

        .. line-block::

          ``text`` String
          :guilabel:`in` The input MRZ line.

          ``type`` :ref:`MrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.


      **Returns**

        .. line-block::

          ``Bool``
          The result of the verification.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentMrzHelper_Check (
            const char * text, 
            id3DocumentMrzType eType, 
            bool * validity)

      **Parameters**

        .. line-block::

          ``text`` const char *
          :guilabel:`in` The input MRZ line.

          ``eType`` :ref:`id3DocumentMrzType<id3_document_mrz_type_enum>`
          :guilabel:`in` The input MRZ type according to ICAO-9303 standard.

          ``validity`` bool *
          :guilabel:`out` The result of the verification.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


