ripmors

Crates.ioripmors
lib.rsripmors
version0.1.0
sourcesrc
created_at2024-06-15 18:05:00.219416
updated_at2024-06-15 18:05:00.219416
descriptionripmors is a library for encoding and decoding international Morse code and several variants
homepage
repositoryhttps://github.com/qsantos/ripmors/
max_upload_size
id1273013
size35,172,183
Quentin Santos (qsantos)

documentation

README

ripmors

ripmors is a Rust library for encoding and decoding international Morse code and several variants.

It is fast:

  • Encoding ASCII text to Morse code: 1.5 GiB/s
  • Encoding Unicode text to Morse code: 730 MiB/s
  • Decoding Morse code: 570 MiB/s
$ echo 'Hello, World!' | ripmors
.... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. ..--.
$ echo '-- --- .-. ... . / -.-. --- -.. .' | ripmors -d
MORSE CODE

Usage

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:

  • Greek
  • Russian (Cyrillic)
  • Japanese (Hiragana, Katakana)
  • Korean (Hangul)
  • Hebrew
  • Arabic
$ 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), "モールスフコ゛ウ");
Commit count: 277

cargo fmt