Skip to content

A simple Morse library written in Golang

License

Notifications You must be signed in to change notification settings

ArkhamCookie/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

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%