Expand description
§Rot
Strongly-typed ascii character rotations in the style of Caesar/Rot/Vigenère ciphers. This is only meant to be some fun with type-level integers in Rust. Please do not use this as an encryption scheme as it is laughably weak.
Structs§
- RotIter
- Wraps a raw character/byte iterator and rotates each item.
- RotU8
- A wrapper over Ascii
u8
which rotates alphabetic characters byN
. This is essentially a per-character Caesar cipher with a shift ofN
. A collection of this type may also be used to implement a strongly-typed Vigenère cipher. An interesting characteristic is that this type can only be converted back to a rawu8
when it has been rotated back into place (i.eN % 26 == 0
), otherwise it is a compile-time type error to do so. It is also type-parameterized over the rotation length to prevent partial/improper ciphers at compile-time. This makes it impossible to use a byte rotated right by 12 when a type contract requires a byte rotated left by 13, for example.
Traits§
- Rotate
- Rotate
Self::Item
byN
.