コード例 #1
0
 def document_number_hash(self) -> bool:
     """Return True if the hash of the document number is validated, False otherwise."""
     if self._document_number_hash == "<":
         doc_number_fin = self._optional_data.rstrip("<")
         self._document_number = self._document_number + "<" + doc_number_fin[:-1]
         self._document_number_hash = doc_number_fin[-1]
     return self.report.add("document number hash", hash_is_ok(self._document_number, self._document_number_hash))
コード例 #2
0
ファイル: td3_india.py プロジェクト: dudarau/mrz
 def optional_data_hash(self) -> bool:
     """Return True if hash of optional data is True, False otherwise."""
     if check.is_empty(
             self._optional_data) and self._optional_data_hash == "<":
         ok = True
     else:
         ok = hash_is_ok(self._optional_data, self._optional_data_hash)
     return self._report("optional data hash", ok)
コード例 #3
0
 def optional_data_hash(self):
     self._optional_data_hash = self.mrz_code.splitlines()[0][29]
     self._optional_data = self.mrz_code.splitlines()[0][15: 29]
     return self._report("id number hash", hash_is_ok(self._optional_data, self._optional_data_hash))