iac

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OLC_SEPARATOR = '+'
	OLC_PADDING   = '0'
	IAC_SEPARATOR = '9'
	IAC_PADDING   = 'A'
)
View Source
const (
	EARTH_RADIUS_IN_METERS = 6371000
)

Variables

View Source
var (
	OLC_ALPHABET   = []rune{'2', '3', '4', '5', '6', '7', '8', '9', 'C', 'F', 'G', 'H', 'J', 'M', 'P', 'Q', 'R', 'V', 'W', 'X'}
	IAC_ALPHABET   = []rune{'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'X', 'W', 'Y', 'Z'}
	OLC_TO_IAC_MAP = make(map[rune]rune, 22)
	IAC_TO_OLC_MAP = make(map[rune]rune, 22)
)
View Source
var (
	ErrInvalidCharInput = errors.New("invalid character in input")
)

Functions

func OLCCodeFromTrytes

func OLCCodeFromTrytes(trytes trinary.Trytes) (result string, err error)

func TrytesFromOLCCode

func TrytesFromOLCCode(code string) (result trinary.Trytes, err error)

Types

type Area

type Area struct {
	olc.CodeArea
	IACCode trinary.Trytes
	OLCCode string
}

func Decode

func Decode(trytes trinary.Trytes) (result *Area, err error)

func (*Area) Distance

func (area *Area) Distance(other *Area) float64

type ErrDecodeFailed

type ErrDecodeFailed struct {
	Inner error
}

func NewErrDecodeFailed

func NewErrDecodeFailed(cause error) *ErrDecodeFailed

func (ErrDecodeFailed) Cause

func (e ErrDecodeFailed) Cause() error

func (ErrDecodeFailed) Error

func (e ErrDecodeFailed) Error() string

Jump to

Keyboard shortcuts

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