Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gSpera/morse

Repository files navigation

Morse

Documentation Go Report Card

Morse is a simple library for encoding and decoding between morse and text.

Support

This library supports the default morse (as defined by ITU-R M.1677-1) code but custom ones can be used freely using a custom EncodingMap

Tool

You can find a simple tool in the cmd/morse directory This tool can be used for converting to/from morse

$ morse > out.morse
test
this is morse.
^C
$ cat out.morse
- . ... - .-.-- .... .. ... .. ... -- --- .-. ... . .-.-.- .-.-
$ morse -D < out.morse
TEST
THIS IS MORSE.

For more uses look use --help

Examples

text := "MORSE IS AWESOME"
//Convert to morse
textInMorse := morse.ToMorse(text)
fmt.Println(textInMorse) //-- --- .-. ... . .. ... .- .-- . ... --- -- .
//Back to text
backToText := morse.ToText(textInMorse)
fmt.Println(backToText) //MORSE IS AWESOME

You can see more examples on the godoc documentation

About

A simple Morse library written in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /