guards

package
v1.0.0-beta.15....-0de5f12 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package guards provides validation functions which are used throughout the entire library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAddressWithChecksum

func IsAddressWithChecksum(addr Trytes) bool

IsAddressWithChecksum checks if the given address is exactly 90 trytes long.

func IsAttachedTrytes

func IsAttachedTrytes(trytes Trytes) bool

IsAttachedTrytes checks if input is valid attached transaction trytes. For attached transactions the last 243 trytes are non-zero.

func IsEmptyTrytes

func IsEmptyTrytes(trytes Trytes) bool

IsEmptyTrytes checks if input is null (all 9s trytes)

func IsHash

func IsHash(trytes Trytes) bool

IsHash checks if input is correct hash (81 trytes or 90)

func IsTag

func IsTag(trytes Trytes) bool

IsTag checks that input is valid tag trytes.

func IsTransactionHash

func IsTransactionHash(trytes Trytes) bool

IsTransactionHash checks whether the given trytes can be a transaction hash.

func IsTransactionHashWithMWM

func IsTransactionHashWithMWM(trytes Trytes, mwm uint) bool

IsTransactionHashWithMWM checks if input is correct transaction hash (81 trytes) with given MWM

func IsTransactionTrytes

func IsTransactionTrytes(trytes Trytes) bool

IsTransactionTrytes checks if input is correct transaction trytes (2673 trytes)

func IsTransactionTrytesWithMWM

func IsTransactionTrytesWithMWM(trytes Trytes, mwm uint) (bool, error)

IsTransactionTrytesWithMWM checks if input is correct transaction trytes (2673 trytes) with given MWM

func IsTrytes

func IsTrytes(trytes Trytes) bool

IsTrytes checks if input is correct trytes consisting of [9A-Z]

func IsTrytesOfExactLength

func IsTrytesOfExactLength(trytes Trytes, length int) bool

IsTrytesOfExactLength checks if input is correct trytes consisting of [9A-Z] and given length

func IsTrytesOfMaxLength

func IsTrytesOfMaxLength(trytes Trytes, max int) bool

IsTrytesOfMaxLength checks if input is correct trytes consisting of [9A-Z] and length <= maxLength

Types

This section is empty.

Directories

Path Synopsis
Package validators leverages package guards to provide easy to use validation functions.
Package validators leverages package guards to provide easy to use validation functions.

Jump to

Keyboard shortcuts

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