|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Implementation of the A1Z26 cipher More...
#include <algorithm>#include <cassert>#include <cstdint>#include <iostream>#include <map>#include <sstream>#include <string>#include <vector>Namespaces | |
| namespace | ciphers |
| Algorithms for encryption and decryption. | |
| namespace | a1z26 |
| Functions for A1Z26 encryption and decryption implementation. | |
Functions | |
| std::string | ciphers::a1z26::encrypt (std::string text) |
| a1z26 encryption implementation More... | |
| std::string | ciphers::a1z26::decrypt (const std::string &text, bool bReturnUppercase=false) |
| a1z26 decryption implementation More... | |
| static void | test () |
| Self-test implementations. More... | |
| int | main () |
| Main function. More... | |
Variables | |
| std::map< uint8_t, char > | ciphers::a1z26::a1z26_decrypt_map |
| std::map< char, uint8_t > | ciphers::a1z26::a1z26_encrypt_map |
Implementation of the A1Z26 cipher
The A1Z26 cipher is a simple substiution cipher where each letter is replaced by the number of the order they're in. For example, A corresponds to 1, B = 2, C = 3, etc.
| std::string ciphers::a1z26::decrypt | ( | const std::string & | text, |
| bool | bReturnUppercase = false |
||
| ) |
a1z26 decryption implementation
| text | is the encrypted text input |
| bReturnUppercase | is if the decoded string should be in uppercase or not |
| std::string ciphers::a1z26::encrypt | ( | std::string | text | ) |
a1z26 encryption implementation
| text | is the plaintext input |
| int main | ( | void | ) |
|
static |
Self-test implementations.
| std::map<uint8_t, char> ciphers::a1z26::a1z26_decrypt_map |
| std::map<char, uint8_t> ciphers::a1z26::a1z26_encrypt_map |