Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
if not public_id:
return "0" * 40
- return hashlib.sha1(public_id).hexdigest()
+ h = hashlib.sha1(public_id.encode())
+ return h.hexdigest()
@property
def private_id(self):
if not private_id:
return "0" * 40
- return hashlib.sha1(private_id).hexdigest()
+ h = hashlib.sha1(private_id.encode())
+ return h.hexdigest()
@property
def secret_id(self):
if os.path.exists(SECRET_ID_FILE):
return read_from_file(SECRET_ID_FILE)
- return hashlib.sha1(self._unique_id).hexdigest()
+ h = hashlib.sha1(self._unique_id.encode())
+ return h.hexdigest()
@property
def _unique_id(self):