Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
from string import printable
import random
EXAMPLE_KEY = ''.join(sorted(printable, key=lambda _:random.random()))
def encode(plaintext, key):
return ''.join(key[printable.index(char)] for char in plaintext)
def decode(plaintext, key):
return ''.join(printable[key.index(char)] for char in plaintext)
original = "A simple example."
encoded = encode(original, EXAMPLE_KEY)
decoded = decode(encoded, EXAMPLE_KEY)
print("""The original is: {}
Encoding it with the key: {}
Gives: {}
Decoding it by the same key gives: {}""".format(
original, EXAMPLE_KEY, encoded, decoded))

View file

@ -0,0 +1,7 @@
The original is: A simple example.
Encoding it with the key: dV1>r7:TLlJa<EFBFBD>uY o]MjH\hI^X cPN#!fmv[
<e=04|O'~{y$bAq@}U.WtF*)x/K?
Q%S(<EFBFBD>RB;25&s6Z9C3+D-_8kn,`Egiwzp"G
Gives:
iPMhX\YiYmJhX\Y5
Decoding it by the same key gives: A simple example.