tbcd

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 2 Imported by: 0

README

tbcd

Basic Implementation of Telephony BCD in pure GoLang

forthebadge forthebadge forthebadge

Building from source

Requires Go to be installed and configured

go get github.com/ranaaditya/tbcd
Usage
package main

import tbcd "github.com/ranaaditya/tbcd"

func main() {

var message string = "0123456789*#abc"
encodedmessage, err := tbcd.EncodeToTBCD(message)

if err == nil {
  fmt.Println("Encoded Message in TBCD format is :", encodedmessage)
} else {  fmt.Println(err) }

originalmessage, err1 := tbcd.DecodeToTBCD(encodedmessage)

if err1 == nil {
  fmt.Println("Decoded message is :", originalmessage)
} else { fmt.Println(err1) }

}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TbcdSymbolMap map[string]string = map[string]string{
	"0": "0000",
	"1": "0001",
	"2": "0010",
	"3": "0011",
	"4": "0100",
	"5": "0101",
	"6": "0110",
	"7": "0111",
	"8": "1000",
	"9": "1001",
	"*": "1010",
	"#": "1011",
	"a": "1100",
	"b": "1101",
	"c": "1110",
	"f": "1111",
}
View Source
var TbcdSymbols = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "#", "a", "b", "c"}

Functions

func DecodeToTBCD

func DecodeToTBCD(input string) (string, error)

func EncodeToTBCD

func EncodeToTBCD(input string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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