|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Implementation of Morse Code. More...
#include <cassert>#include <iostream>#include <string>#include <vector>Namespaces | |
| namespace | ciphers |
| Base64 Encoding and Decoding | |
| namespace | morse |
| Functions for Morse Code. | |
Functions | |
| std::string | ciphers::morse::char_to_morse (const char &c) |
| char | ciphers::morse::morse_to_char (const std::string &s) |
| std::string | ciphers::morse::encrypt (const std::string &text) |
| std::string | ciphers::morse::decrypt (const std::string &text) |
| static void | test () |
| Function to test above algorithm. More... | |
| int | main () |
| Main function. More... | |
Implementation of Morse Code.
Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called dots and dashes or dits and dahs. Morse code is named after Samuel Morse, an inventor of the telegraph.
| std::string ciphers::morse::char_to_morse | ( | const char & | c | ) |
Get the morse representation for given character.
| c | Character |
| std::string ciphers::morse::decrypt | ( | const std::string & | text | ) |
Decrypt given morse coded text.
| text | text to be decrypted |
| std::string ciphers::morse::encrypt | ( | const std::string & | text | ) |
Encrypt given text using morse code.
| text | text to be encrypted |
| int main | ( | void | ) |
| char ciphers::morse::morse_to_char | ( | const std::string & | s | ) |
Get character from the morse representation.
| s | Morse representation |
|
static |
Function to test above algorithm.