Last active
July 3, 2019 15:21
-
-
Save lemire/3e7f0623798e6db0121cb7bdcab5512d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(x): | |
r1 = (x + 212) % 256 | |
r2 = x | 32 | |
table = [44, 125, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 123 ] | |
if ((r1&0x80)==0x80): | |
r3 = 0 | |
else: | |
r3 = table[r1& 0xF] | |
r4 = r2 == r3 | |
return r4 | |
def g(x): | |
table = [32, 100, 100, 100, 17, 100, 113, 2, 100, 9, 10, 112, 100, 13, 100, 100] | |
if ((x&0x80)==0x80): | |
r1 = 0 | |
else: | |
r1 = table[x& 0xF] | |
return x == r1 | |
for i in range(256): | |
if(f(i)): | |
print(str(i)+ " "+chr(i)) | |
for i in range(256): | |
if(g(i)): | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment