addressConverters

package
v1.0.103 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashAddressConverter

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

HashAddressConverter is used to convert the address from/to different structures

func NewHashAddressConverter

func NewHashAddressConverter(hasher hashing.Hasher, addressLen int, prefix string) (*HashAddressConverter, error)

NewHashAddressConverter creates a new instance of HashAddressConverter

func (*HashAddressConverter) AddressLen

func (hac *HashAddressConverter) AddressLen() int

AddressLen returns the address length

func (*HashAddressConverter) ConvertToHex

func (hac *HashAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)

ConvertToHex returns the hex string representation of the address.

func (*HashAddressConverter) CreateAddressFromHex

func (hac *HashAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)

CreateAddressFromHex creates the address from hex string

func (*HashAddressConverter) CreateAddressFromPublicKeyBytes

func (hac *HashAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)

CreateAddressFromPublicKeyBytes hashes the bytes received as parameters, trimming if necessary and outputs a new AddressContainer obj

func (*HashAddressConverter) IsInterfaceNil

func (hac *HashAddressConverter) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HashAddressConverter) PrepareAddressBytes

func (hac *HashAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)

PrepareAddressBytes checks and returns the slice compatible to the address format

type PlainAddressConverter

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

PlainAddressConverter is used to convert the address from/to different structures

func NewPlainAddressConverter

func NewPlainAddressConverter(addressLen int, prefix string) (*PlainAddressConverter, error)

NewPlainAddressConverter creates a new instance of HashAddressConverter

func (*PlainAddressConverter) AddressLen

func (pac *PlainAddressConverter) AddressLen() int

AddressLen returns the address length

func (*PlainAddressConverter) ConvertToBech32

func (pac *PlainAddressConverter) ConvertToBech32(addressContainer state.AddressContainer) (string, error)

ConvertToBech32 returns the address in bech32 format

func (*PlainAddressConverter) ConvertToHex

func (pac *PlainAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)

ConvertToHex returns the hex string representation of the address.

func (*PlainAddressConverter) CreateAddressFromBech32

func (pac *PlainAddressConverter) CreateAddressFromBech32(bech32Address string) (state.AddressContainer, error)

CreateAddressFromBech32 creates the address from bech32 string

func (*PlainAddressConverter) CreateAddressFromHex

func (pac *PlainAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)

CreateAddressFromHex creates the address from hex string

func (*PlainAddressConverter) CreateAddressFromPublicKeyBytes

func (pac *PlainAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)

CreateAddressFromPublicKeyBytes returns the bytes received as parameters, trimming if necessary and outputs a new AddressContainer obj

func (*PlainAddressConverter) IsInterfaceNil

func (pac *PlainAddressConverter) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PlainAddressConverter) PrepareAddressBytes

func (pac *PlainAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)

PrepareAddressBytes checks and returns the slice compatible to the address format

Jump to

Keyboard shortcuts

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