Merge pull request #69 from loskiq/patch-1

Update mikro.py
This commit is contained in:
elseif 2024-12-14 12:40:05 +08:00 committed by GitHub
commit 098f967cfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,8 +39,8 @@ def mikro_softwareid_encode(id:int)->str:
assert(isinstance(id, int)) assert(isinstance(id, int))
ret = '' ret = ''
for i in range(8): for i in range(8):
ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % 0x23]) ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % len(SOFTWARE_ID_CHARACTER_TABLE)])
id //= 0x23 id //= len(SOFTWARE_ID_CHARACTER_TABLE)
if i == 3: if i == 3:
ret += '-' ret += '-'
return ret return ret