hello there

This commit is contained in:
Jean-Marie Mineau 2021-12-07 23:11:08 +01:00
commit 7107be2bd0
No known key found for this signature in database
GPG key ID: 67486F107F62E9E9
7 changed files with 574 additions and 0 deletions

27
cipher.py Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env python3
import sys
def proc1(s:str)->list[int]:
ret_list = []
for i, c in enumerate(s):
ret_list.append(proc3(ord(c)+i))
return ret_list
def proc3(a:int):
w3 = 1
w2 = 1
w4 = a & 255
while (w2 <= w4):
w3 *= 3
while (w3 > 256):
w3 -= 257
w2 += 1
return w3 & 255
def test(s):
for c in proc1(s):
print(hex(c))
if __name__ == "__main__":
test(sys.argv[1])