From e61c981f841441a1a00616faf7c6e79b1cd66990 Mon Sep 17 00:00:00 2001 From: Amir Date: Fri, 13 Dec 2024 17:23:54 +0300 Subject: [PATCH] Update mikro.py Signed-off-by: Amir --- mikro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mikro.py b/mikro.py index 44736f4..5cede9a 100644 --- a/mikro.py +++ b/mikro.py @@ -39,8 +39,8 @@ def mikro_softwareid_encode(id:int)->str: assert(isinstance(id, int)) ret = '' for i in range(8): - ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % 0x23]) - id //= 0x23 + ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % len(SOFTWARE_ID_CHARACTER_TABLE)]) + id //= len(SOFTWARE_ID_CHARACTER_TABLE) if i == 3: ret += '-' return ret @@ -205,4 +205,4 @@ def mikro_kcdsa_verify(data:bytes, signature:bytes, public_key:bytes)->bool: nonce = int((public_key * signature + curve.G * data_hash).x) if mikro_sha256(Tools.inttobytes_le(nonce,32))[:len(nonce_hash)] == nonce_hash: return True - return False \ No newline at end of file + return False