address

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAC1

func FormatAC1(hash []byte) string

FormatAC1 formats the hash of an Accumulate public key as an Accumulate AC1 address.

func FormatAS1

func FormatAS1(seed []byte) string

FormatAS1 formats an Accumulate private key as an Accumulate AS1 address.

func FormatBTC

func FormatBTC(hash []byte) string

FormatBTC formats the hash of a Bitcoin public key as a P2PKH address, additionally prefixed with 'BT'.

func FormatETH

func FormatETH(hash []byte) string

FormatETH formats the hash of an Ethereum public key as an Ethereum address.

func FormatFA

func FormatFA(hash []byte) string

FormatFA formats the hash of a Factom public key as a Factom FA address.

func FormatFs

func FormatFs(seed []byte) string

FormatFs formats a Factom private key as a Factom Fs address.

func FormatMH

func FormatMH(hash []byte, code uint64) string

FormatMH formats an unknown hash as a multihash Accumulate address.

Types

type Address

type Address interface {
	String() string
	GetType() protocol.SignatureType
	GetPublicKeyHash() ([]byte, bool)
	GetPublicKey() ([]byte, bool)
	GetPrivateKey() ([]byte, bool)
}

func Parse

func Parse(s string) (Address, error)

type Lite

type Lite struct {
	Url   *url.URL
	Bytes []byte
}

func (*Lite) GetPrivateKey

func (l *Lite) GetPrivateKey() ([]byte, bool)

func (*Lite) GetPublicKey

func (l *Lite) GetPublicKey() ([]byte, bool)

func (*Lite) GetPublicKeyHash

func (l *Lite) GetPublicKeyHash() ([]byte, bool)

func (*Lite) GetType

func (l *Lite) GetType() protocol.SignatureType

func (*Lite) String

func (l *Lite) String() string

type PrivateKey

type PrivateKey struct {
	PublicKey
	Key []byte
}

func (*PrivateKey) GetPrivateKey

func (p *PrivateKey) GetPrivateKey() ([]byte, bool)

func (*PrivateKey) String

func (p *PrivateKey) String() string

type PublicKey

type PublicKey struct {
	Type protocol.SignatureType
	Key  []byte
}

func (*PublicKey) GetPrivateKey

func (p *PublicKey) GetPrivateKey() ([]byte, bool)

func (*PublicKey) GetPublicKey

func (p *PublicKey) GetPublicKey() ([]byte, bool)

func (*PublicKey) GetPublicKeyHash

func (p *PublicKey) GetPublicKeyHash() ([]byte, bool)

func (*PublicKey) GetType

func (p *PublicKey) GetType() protocol.SignatureType

func (*PublicKey) String

func (p *PublicKey) String() string

type PublicKeyHash

type PublicKeyHash struct {
	Type protocol.SignatureType
	Hash []byte
}

func (*PublicKeyHash) GetPrivateKey

func (p *PublicKeyHash) GetPrivateKey() ([]byte, bool)

func (*PublicKeyHash) GetPublicKey

func (p *PublicKeyHash) GetPublicKey() ([]byte, bool)

func (*PublicKeyHash) GetPublicKeyHash

func (p *PublicKeyHash) GetPublicKeyHash() ([]byte, bool)

func (*PublicKeyHash) GetType

func (p *PublicKeyHash) GetType() protocol.SignatureType

func (*PublicKeyHash) String

func (p *PublicKeyHash) String() string

type Unknown

type Unknown struct {
	Value    []byte
	Encoding rune
}

func (*Unknown) GetPrivateKey

func (u *Unknown) GetPrivateKey() ([]byte, bool)

func (*Unknown) GetPublicKey

func (u *Unknown) GetPublicKey() ([]byte, bool)

func (*Unknown) GetPublicKeyHash

func (u *Unknown) GetPublicKeyHash() ([]byte, bool)

func (*Unknown) GetType

func (u *Unknown) GetType() protocol.SignatureType

func (*Unknown) String

func (u *Unknown) String() string

type UnknownHash

type UnknownHash struct {
	Hash []byte
}

func (*UnknownHash) GetPrivateKey

func (u *UnknownHash) GetPrivateKey() ([]byte, bool)

func (*UnknownHash) GetPublicKey

func (u *UnknownHash) GetPublicKey() ([]byte, bool)

func (*UnknownHash) GetPublicKeyHash

func (u *UnknownHash) GetPublicKeyHash() ([]byte, bool)

func (*UnknownHash) GetType

func (u *UnknownHash) GetType() protocol.SignatureType

func (*UnknownHash) String

func (u *UnknownHash) String() string

type UnknownMultihash

type UnknownMultihash multihash.DecodedMultihash

func (*UnknownMultihash) GetPrivateKey

func (u *UnknownMultihash) GetPrivateKey() ([]byte, bool)

func (*UnknownMultihash) GetPublicKey

func (u *UnknownMultihash) GetPublicKey() ([]byte, bool)

func (*UnknownMultihash) GetPublicKeyHash

func (u *UnknownMultihash) GetPublicKeyHash() ([]byte, bool)

func (*UnknownMultihash) GetType

func (*UnknownMultihash) String

func (u *UnknownMultihash) String() string

Jump to

Keyboard shortcuts

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