![]() |
TheAlgorithms/C++ 1.0.0
All the 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>Go to the source code of this file.
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 | |
| std::string | ciphers::a1z26::decrypt (const std::string &text, bool bReturnUppercase=false) |
| a1z26 decryption implementation | |
| static void | test () |
| Self-test implementations. | |
| int | main () |
| Main function. | |
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.
Definition in file a1z26_cipher.cpp.
| 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 |
Definition at line 78 of file a1z26_cipher.cpp.
| std::string ciphers::a1z26::encrypt | ( | std::string | text | ) |
a1z26 encryption implementation
| text | is the plaintext input |
Definition at line 51 of file a1z26_cipher.cpp.
| int main | ( | void | ) |
Main function.
Definition at line 159 of file a1z26_cipher.cpp.
|
static |
Self-test implementations.
Definition at line 120 of file a1z26_cipher.cpp.
| std::map<uint8_t, char> ciphers::a1z26::a1z26_decrypt_map |
Definition at line 33 of file a1z26_cipher.cpp.
| std::map<char, uint8_t> ciphers::a1z26::a1z26_encrypt_map |
Definition at line 40 of file a1z26_cipher.cpp.