ePass: Python 3 compatibility
This commit is contained in:
@@ -215,10 +215,7 @@ def hash(hashmethod, data):
|
|||||||
def operation_on_string(string1, string2, op):
|
def operation_on_string(string1, string2, op):
|
||||||
if len(string1) != len(string2):
|
if len(string1) != len(string2):
|
||||||
raise ValueError("string1 and string2 must be of equal length")
|
raise ValueError("string1 and string2 must be of equal length")
|
||||||
result = []
|
return bytes([op(_a, _b) for _a, _b in zip(string1, string2)])
|
||||||
for i in range(len(string1)):
|
|
||||||
result.append(chr(op(ord(string1[i]), ord(string2[i]))))
|
|
||||||
return "".join(result)
|
|
||||||
|
|
||||||
|
|
||||||
# *******************************************************************
|
# *******************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user