Skip to content

ranaaditya/tbcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
    }

}

Get it on pkg.go.dev