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))
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)
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))