From b80e070b4dd05c7424aa597f4ced38e714ad5b08 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 8 Mar 2024 19:50:16 +0300 Subject: [PATCH] dev@locazia: fix math --- app/core/content/content_id.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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())