More general changes, and get mobidedrm and kindlekey to work on Mac.

This commit is contained in:
Apprentice Harper
2020-10-14 16:23:49 +01:00
parent e31752e334
commit 781268e17e
32 changed files with 479 additions and 497 deletions

View File

@@ -52,11 +52,11 @@ def SHA1(message):
def encode(data, map):
result = ''
for char in data:
value = char
value = ord(char)
Q = (value ^ 0x80) // len(map)
R = value % len(map)
result += chr(map[Q])
result += chr(map[R])
result += map[Q]
result += map[R]
return result
# Hash the bytes in data and then encode the digest with the characters in map