# decode static method

StringDict decode(

1. String? text,
2. MrzType type

)

Decodes an MRZ of a given type and returns the values of the various fields.

param text The input MRZ. param type The input MRZ type according to ICAO-9303 standard. return A dictionary containing the fields and values decoded in the MRZ. throws DocumentException An error has occurred during Document Library execution.

## Implementation

    static StringDict decode(String? text, MrzType type) {
      Pointer<Char>? pText = text?.toNativeUtf8().cast<Char>();
      StringDict fields = StringDict();
      try {
        var err = documentSDK.id3DocumentMrzHelper_Decode(pText ?? nullptr, type.value, fields.handle);
        if (err != DocumentError.success.value) {
          fields.dispose();
          throw DocumentException(err);
        }
        return fields;
      } finally {
        if (pText != null) {
          calloc.free(pText);
        }
      }
    }