#139 fix base62 issue

This commit is contained in:
kokarare1212
2022-07-12 07:42:25 +09:00
parent aeaf2a07bf
commit 0a682993c8
2 changed files with 21 additions and 21 deletions

View File

@@ -64,8 +64,7 @@ class Base62:
def translate(self, indices: bytes, dictionary: bytes):
translation = bytearray(len(indices))
for i in range(len(indices)):
translation[i] = dictionary[int.from_bytes(indices[i].encode(),
"big")]
translation[i] = dictionary[int.from_bytes(bytes([indices[i]]), "big")]
return translation
def convert(self, message: bytes, source_base: int, target_base: int,