Skip to content

Instantly share code, notes, and snippets.

@lemire
Last active July 3, 2019 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lemire/3e7f0623798e6db0121cb7bdcab5512d to your computer and use it in GitHub Desktop.
Save lemire/3e7f0623798e6db0121cb7bdcab5512d to your computer and use it in GitHub Desktop.
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