diff --git a/app/core/content/content_id.py b/app/core/content/content_id.py index 4ccd9b9..de02a61 100644 --- a/app/core/content/content_id.py +++ b/app/core/content/content_id.py @@ -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())