util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrEqualCode added in v0.4.0

func ErrEqualCode(err error, code codes.Code) bool

func FindAndParseConfigFile

func FindAndParseConfigFile(configFile string, out interface{}) error

FindAndParseConfigFile locates the config file and parses it, storing the result in out.

func GetConfigFileLocation

func GetConfigFileLocation(location string) (string, error)

func GetDefaultKeyLocation

func GetDefaultKeyLocation() (string, error)

func Hash160

func Hash160(buf []byte) []byte

Hash160 calculates the hash ripemd160(sha256(b)).

func Hash256

func Hash256(data []byte) []byte

Hash256 does two rounds of SHA256 hashing.

func NowMs

func NowMs() int64

NowMs returns current time as milliseconds from epoch.

func SerializedCompressedToAddress added in v0.4.0

func SerializedCompressedToAddress(key []byte) string

SerializedCompressedToAddress is a convenience function which converts serialized compressed representation of the private key to its address (which is shorter). If the key is invalid, the return string will contain an error message.

func StatusCodeFromError added in v0.4.0

func StatusCodeFromError(err error) codes.Code

func TimeFromMs

func TimeFromMs(ts int64) time.Time

func ValidateName

func ValidateName(name string) bool

ValidateName returns true if the name is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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