utils

package
v0.0.0-...-ee15e7f Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IBAN_LEN       = 21
	COUNTRY_ID_LEN = 2
)
View Source
const CharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
	"abcdefghijklmnopqrstuvwxyz" +
	"1234567890" +
	`+-_"*%&<>()=?!:;@#/\|{}[].,`

Variables

View Source
var QR_MATRIX = [10][10]int{
	{0, 9, 4, 6, 8, 2, 7, 1, 3, 5},
	{9, 4, 6, 8, 2, 7, 1, 3, 5, 0},
	{4, 6, 8, 2, 7, 1, 3, 5, 0, 9},
	{6, 8, 2, 7, 1, 3, 5, 0, 9, 4},
	{8, 2, 7, 1, 3, 5, 0, 9, 4, 6},
	{2, 7, 1, 3, 5, 0, 9, 4, 6, 8},
	{7, 1, 3, 5, 0, 9, 4, 6, 8, 2},
	{1, 3, 5, 0, 9, 4, 6, 8, 2, 7},
	{3, 5, 0, 9, 4, 6, 8, 2, 7, 1},
	{5, 0, 9, 4, 6, 8, 2, 7, 1, 3},
}

Functions

func GetEnglishTranslationTable

func GetEnglishTranslationTable() *specs.TranslationTable

func GetQrReferenceCheckNum

func GetQrReferenceCheckNum(qrReference string) (string, error)

func GetSha256

func GetSha256(plain []byte) string

func ReadQr

func ReadQr(qrPath string) (string, error)

func ValidateIban

func ValidateIban(iban string) error

func ValidateReference

func ValidateReference(referenceType string, reference string) error

Types

type Token

type Token struct {
	Plain  string
	Sha256 string
}

func CreateNewToken

func CreateNewToken(length int) Token

Jump to

Keyboard shortcuts

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