dev@locazia: fix math

This commit is contained in:
user 2024-03-08 19:50:16 +03:00
parent cc8b830260
commit b80e070b4d
1 changed files with 2 additions and 2 deletions

View File

@ -44,10 +44,10 @@ class ContentId:
)
if not (self.safe_onchain_index is None):
oi_bin_hex = hex(self.safe_onchain_index)[2:]
if len(oi_bin_hex) % 2:
if len(oi_bin_hex) % 2 == 1:
oi_bin_hex = '0' + oi_bin_hex
oi_bin_len = len(oi_bin_hex) / 2
oi_bin_len = len(oi_bin_hex) // 2
cid_bin += b'\xb0' + oi_bin_len.to_bytes(1, 'big') + bytes.fromhex(oi_bin_hex)
if self.accept_type and include_accept_type:
at_bin_len = len(self.accept_type.encode())