Module utils

Source
Expand description

Misc utilities for Enigma

Structs§

ConversionError
Error converting types

Enums§

Letter
Represent a letter in the enigma machine. Essentially a u8 mod 26.

Constants§

DEFAULT_ROTOR_NUM
Number of rotors to use by default
M3
Number of rotors for the M3 Enigma
M4
Number of rotors for the M4 Enigma
UNIT_LETTER_MAP
A LetterMapping where all letters map to themselves

Functions§

string_to_inv_letter_map
Creates a LetterMapping from a string that is the exact opposite of string_to_letter_map
string_to_letter_map
Creates a LetterMapping from a string where mapping[i] = string[i]

Type Aliases§

LetterMapping
Represents the internal wiring of an Enigma component. Essentially a substitution cipher where the substitution of a letter is the value at its index