sgu

package
v1.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package base58 implements a human-friendly base58 encoding.

As opposed to base64 and friends, base58 is typically used to convert integers. You can use big.Int.SetBytes to convert arbitrary bytes to an integer first, and big.Int.Bytes the other way around.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultStruct = &Verifier{}
	CoinName      = "sgu"
)

for register

Functions

func AddressToBytes

func AddressToBytes(address string) ([]byte, error)

func Byte2Hex

func Byte2Hex(data byte) string

func Decode

func Decode(value string) ([]byte, error)

Decode decodes base58 value to bytes.

func DecodeToBig

func DecodeToBig(src []byte) (*big.Int, error)

DecodeToBig a big integer from the bytes. Returns an error on corrupt input.

func Encode

func Encode(encoded []byte) string

Encode encodes byteData to base58.

func EncodeBig

func EncodeBig(dst []byte, src *big.Int) []byte

EncodeBig encodes src, appending to dst. Be sure to use the returned new value of dst.

func Hex2Byte

func Hex2Byte(data []byte) string

func ValidateAddress

func ValidateAddress(address string) (bool, error)

Types

type CorruptInputError

type CorruptInputError int64

CorruptInputError representds input is corrupted.

func (CorruptInputError) Error

func (e CorruptInputError) Error() string

Error is to implement Error interface.

type Verifier

type Verifier struct{}

func (Verifier) IsValid

func (b Verifier) IsValid(address string) bool

Jump to

Keyboard shortcuts

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