kyu_3.rail_fence_cipher_encoding_and_decoding package¶
Submodules¶
kyu_3.rail_fence_cipher_encoding_and_decoding.encoding_and_decoding module¶
-
kyu_3.rail_fence_cipher_encoding_and_decoding.encoding_and_decoding.
decode_rail_fence_cipher
(string: str, n: int) → str[source]¶ Function/method that takes 2 arguments, an encoded string and the number of rails, and returns the DECODED string.
- Parameters
string – an encoded string
n – the number of rails
- Returns
the DECODED string
-
kyu_3.rail_fence_cipher_encoding_and_decoding.encoding_and_decoding.
encode_rail_fence_cipher
(string: str, n: int) → str[source]¶ This cipher is used to encode a string by placing each character successively in a diagonal along a set of “rails”. First start off moving diagonally and down. When you reach the bottom, reverse direction and move diagonally and up until you reach the top rail. Continue until you reach the end of the string. Each “rail” is then read left to right to derive the encoded string.
- Parameters
string – a string
n – the number of rails
- Returns
the ENCODED string
kyu_3.rail_fence_cipher_encoding_and_decoding.test_decoding module¶
Testing Decoding functionality
kyu_3.rail_fence_cipher_encoding_and_decoding.test_encoding module¶
Testing Encoding functionality