Cipher - Morse codecipher

Source

CIPHER - MORSE CODE (METHOD)

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, one of the inventors of the telegraph. International morse code

S.O.S example:

["...","---","..."," ","...","---","..."]
["s","o","s"," ","s","o","s"]

["sos"] = ["... --- ..."]

info

in this example run Test contract. send a Letter & an Address by using sendMsg function. receive and decode message by using the recipient address inreceiveMsg function.


morse code usecase

function receiveMsg(bytes memory message) public view returns (string memory) {
	(string memory code, ) = dehash(message);
	return morse_to_char(code);
}

function sendMsg(string memory letter, address recipient) public pure returns (bytes memory) {
	return hash(char_to_morse(letter), recipient);
}