コード例 #1
0
 def password(self, password):
     # do not use the original password but the hash instead
     password_bytes = password.encode('UTF-8')
     self.bytes = hash_binary(password_bytes)
     self.hash = hash_hex(self.bytes)
     assert password_bytes != self.bytes
     assert password_bytes != self.hash_bytes
     assert self.bytes != self.hash_bytes
コード例 #2
0
 def hash(self):
     if self._hash is None:
         self.ask()
     if self.has_bytes(): # negligible race condition
         assert self._hash == hash_hex(self.bytes)
     return self._hash
コード例 #3
0
 def hash(self):
     if self._hash is None:
         self.initialize_master_password()
     if self.has_bytes(): # negligible race condition
         assert self._hash == hash_hex(self.bytes)
     return self._hash