[][src]Function crypto_morse::decode

pub fn decode(input: &str) -> String

Decodes a morse representation string into an ascii string

Examples

use morse::decode;

assert_eq!(decode::decode("... ___ ...").unwrap(), "sos");

Errors

Decoding will error with a morse::TranslationError when an unsupported morse character is being decoded. The error structure contains a Vec<String> unsupported_characters to show what characters failed.

Notice

SOS HELP = ...... .... . ... .. => ................ I AM HIS DATE = .. ._ __ .... .. ... .. . _ . => ................