add readme

This commit is contained in:
lda committed 2026-10-03 03:19:59 +07:00 Verified
1 parent 51b6dbe5d4
commit fe5eeea52f
2 files changed
+16 -1

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# encryption method
based 100% on that one Veritasium video
several bugs raised + fixed by codex
## what is the encryption method
the enigma machine. a "rotor cipher"
`App` takes several rotors, the reflector, and optionally those keyboard configs...
each rotor is the pairing mechanism, and the rotating + carry/notch thing mechanism
+3 -1
View File
@@ -37,7 +37,9 @@ class index_mapper:
def verify(i: list[int]):
if not i:
raise ValueError("index_mapper: i must not be empty")
if set(i) != set(range(len(i))): # this also clears uniqueness
if len(i) != len(set(i)):
raise ValueError("index_mapper: i must not contain duplicates")
if set(i) != set(range(len(i))): # this clears range
raise ValueError("index_mapper: i must be a permutation of range(len(i))")