Skip to content

Commit

Permalink
updated parse fn
Browse files Browse the repository at this point in the history
  • Loading branch information
sivakumar-mahalingam committed Apr 6, 2024
1 parent b184092 commit b462ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/Laghima.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _parse_mrz(self, mrz_text):
if self._get_check_digit(mrz_code_dict['date_of_expiry']) != mrz_text[1][27]:
return {'status': 'FAILURE', 'message': 'date of expiry checksum is not matching'}
mrz_code_dict['date_of_expiry'] = self._format_date(mrz_code_dict['date_of_expiry'])
if mrz_text[1][-1] != self._get_final_check_digit(mrz_text[1], mrz_code_dict['type']):
if mrz_text[1][-1] != self._get_final_check_digit(mrz_text[1], mrz_code_dict['mrz_type']):
return {'status': 'FAILURE', 'message': 'final checksum is not matching'}

# Final status
Expand Down Expand Up @@ -166,7 +166,7 @@ def _parse_mrz(self, mrz_text):
mrz_code_dict['date_of_expiry'] = self._format_date(mrz_code_dict['date_of_expiry'])
mrz_code_dict['nationality'] = mrz_text[1][15:18]
mrz_code_dict['optional_data_2'] = mrz_text[0][18:29].strip('<')
if mrz_text[1][-1] != self._get_final_check_digit(mrz_text, mrz_code_dict['type']):
if mrz_text[1][-1] != self._get_final_check_digit(mrz_text, mrz_code_dict['mrz_type']):
return {'status': 'FAILURE', 'message': 'final checksum is not matching'}

# Line 3
Expand Down

0 comments on commit b462ee2

Please sign in to comment.