morse

package
v0.0.0-...-86b28ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ITUEncoding = NewEncoding(morseITU, " ", "/")

ITUEncoding is the standard morse ITU encoding.

Functions

func LooksLikeMorse

func LooksLikeMorse(s string) bool

LooksLikeMorse returns true if string seems to be a morse encoded string

Types

type Encoding

type Encoding struct {
	// contains filtered or unexported fields
}

An Encoding is a radix 62 encoding/decoding scheme, defined by a 62-character alphabet.

func NewEncoding

func NewEncoding(alphabet map[string]string, letterSeparator, wordSeparator string) *Encoding

func (*Encoding) Decode

func (enc *Encoding) Decode(s []byte) ([]byte, error)

Decode decodes morse code in `s` using `alphabet` mapping

func (*Encoding) DecodeString

func (enc *Encoding) DecodeString(s string) ([]byte, error)

DecodeString returns the bytes represented by the base62 string s.

func (*Encoding) Encode

func (enc *Encoding) Encode(s []byte) []byte

Encode encodes clear text in `s` using `alphabet` mapping

func (*Encoding) EncodeToString

func (enc *Encoding) EncodeToString(src []byte) string

EncodeToString returns the base62 encoding of src.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL