Crates.io | ripmors |
lib.rs | ripmors |
version | 0.1.0 |
source | src |
created_at | 2024-06-15 18:05:00.219416 |
updated_at | 2024-06-15 18:05:00.219416 |
description | ripmors is a library for encoding and decoding international Morse code and several variants |
homepage | |
repository | https://github.com/qsantos/ripmors/ |
max_upload_size | |
id | 1273013 |
size | 35,172,183 |
ripmors is a Rust library for encoding and decoding international Morse code and several variants.
It is fast:
$ echo 'Hello, World!' | ripmors
.... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. ..--.
$ echo '-- --- .-. ... . / -.-. --- -.. .' | ripmors -d
MORSE CODE
Or, in Rust:
use ripmors::{decode_string, encode_string, to_standard};
assert_eq!(encode_string("Hello, World!"), ".... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. ..--.");
assert_eq!(decode_string(b"-- --- .-. ... . / -.-. --- -.. .", to_standard), "MORSE CODE");
In addition to the standard International Morse Code and its Latin extensions, the following variants are supported:
$ echo 'モールスふごう' | ripmors
-..-. .--.- -.--. ---.- --.. ---- .. ..-
$ echo '-..-. .--.- -.--. ---.- --.. ---- .. ..-' | ripmors -d japanese
モールスフコ゛ウ
Or, in Rust:
use ripmors::{decode_string, encode_string, to_japanese};
assert_eq!(encode_string("モールスふごう"), "-..-. .--.- -.--. ---.- --.. ---- .. ..-");
assert_eq!(decode_string(b"-..-. .--.- -.--. ---.- --.. ---- .. ..-", to_japanese), "モールスフコ゛ウ");