ePass: Python 3 compatibility

This commit is contained in:
Frank Morgner
2022-02-02 16:36:27 +01:00
parent ccb482cfe9
commit a982efd8c5

View File

@@ -215,10 +215,7 @@ def hash(hashmethod, data):
def operation_on_string(string1, string2, op):
if len(string1) != len(string2):
raise ValueError("string1 and string2 must be of equal length")
result = []
for i in range(len(string1)):
result.append(chr(op(ord(string1[i]), ord(string2[i]))))
return "".join(result)
return bytes([op(_a, _b) for _a, _b in zip(string1, string2)])
# *******************************************************************