tools

package
v0.0.0-...-2334cb8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2016 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetHash

func DetHash(h types.Hasher) string

Deterministically takes hash (defaults to sha256) of dict, list, int, or string. String representations, (what is feed into hash fn, in python+go pseudocode): - list: fmt.Sprintf("[%s]", ",".join(map(det, sorted(payload)))) - dict: fmt.Sprintf("{%s}", ",".join(map(lambda p: det(p[0]) + ":" + det(p[1]), sorted(x.items())))) - int: str(payload) - string: payload return hash_(json.loads(json.dumps(payload_string))))

func DetHashInt

func DetHashInt(h int) string

func DetHashString

func DetHashString(h string) string

func In

func In(s string, cases []string) bool

func JSONLen

func JSONLen(value interface{}) int

func MakeAddress

func MakeAddress(pubkeys []*btcec.PublicKey, n int) string

n is the number of pubkeys required to spend from this address.

func Max

func Max(a, b int) int

func NotIn

func NotIn(s string, ss []string) bool

func ParseKeyPair

func ParseKeyPair(privkey string) (*btcec.PrivateKey, *btcec.PublicKey)

func Sign

func Sign(msg []byte, privkey *btcec.PrivateKey) (*btcec.Signature, error)

func Verify

func Verify(msg []byte, sig *btcec.Signature, pubkey *btcec.PublicKey) bool

func ZerosLeft

func ZerosLeft(s string, size int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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