utils

package
v0.0.0-...-6653c62 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 13 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Const4bytessigner  = 32
	Const4bytesaddress = 40
)
View Source
const Mosaicdefinition = 0x4001 // 16385

The mosaic definition transaction type

View Source
const MultisigSignature = 0x1002 // 4098

The multisignature signature transaction type

View Source
const ProvisionNamespace = 0x2001 // 8193

The provision namespace transaction type

Variables

This section is empty.

Functions

func Bt2Hex

func Bt2Hex(b []byte) string

Convert an []Bytes to hex param b - An []Bytes return string

func BtToUtf8

func BtToUtf8(ua []byte) string

Convert Bytes slice to UTF-8 string param ua - An slice Bytes return string

func CleanTextAmount

func CleanTextAmount(n string) float64

Clean a text input amount and return it as number param n - The number as a string return The clean amount

func CreateNEMTimeStamp

func CreateNEMTimeStamp() int64

Create a time stamp for a NEM transaction return The NEM transaction time stamp in milliseconds

func FixPrivateKey

func FixPrivateKey(privateKey string) string

Fix a private key param privatekey - An hex private key return - The fixed hex private key

func FormatEndpoint

func FormatEndpoint(endpoint base.Node) string

Convert an endpoint object to an endpoint url param endpoint - An endpoint object return An endpoint url

func Grep

func Grep(item []base.Properties) map[string]string

Mimics jQuery's grep function

func Hex2BaReversed

func Hex2BaReversed(hexx string) []byte

Hex2BaReversed Reversed convertion of hex to []Bytes. param hexx - An hex string return []Bytes

func Hex2Bt

func Hex2Bt(hexx string) []byte

Convert hex to []Bytes param hexx - An hex string return bytes

func Hex2a

func Hex2a(hexx string) string

Convert hex to string param hexx - An hex string return string

func IsHexadecimal

func IsHexadecimal(str string) bool

Test if a string is hexadecimal param str - A string to test return True if correct, false otherwise

func IsPrivateKeyValid

func IsPrivateKeyValid(privateKey string) bool

Check if a private key is valid param privatekey - A private key eturn True if valid, false otherwise

func IsPublicKeyValid

func IsPublicKeyValid(publicKey string) bool

Check if a public key is valid param publicKey - A public key return - True if valid, false otherwise

func MosaicIdToName

func MosaicIdToName(mosaicId base.MosaicID) string

Return mosaic name from mosaicId object param mosaicId - A mosaicId object return The mosaic name

func PubToAddress

func PubToAddress()

Convert a public key to NEM address param input - The account public key param networkId - The current network id return - A clean NEM address

func SerializeTransaction

func SerializeTransaction(entity interface{}) []byte

Serialize a transaction struct param entity - A transaction struct return The serialized transaction

func Struc2Json

func Struc2Json(data interface{}) string

func Utf8ToHex

func Utf8ToHex(str string) string

Convert UTF-8 to hex @param str - An UTF-8 string @return string

Types

type Temporary

type Temporary struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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