utils

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BTCPRIKEYStrToHexAddr

func BTCPRIKEYStrToHexAddr(privateKeyStr string) (string, string, error)

func CheckContentType

func CheckContentType(ty string) bool

func EcdsaToPrivateStr

func EcdsaToPrivateStr(ecd *ecdsa.PrivateKey) string

func FromECDSA

func FromECDSA(priv *ecdsa.PrivateKey) []byte

FromECDSA exports a private key into a binary dump.

func MIMEType

func MIMEType(filePath string) map[string]interface{}

func PaddedBigBytes

func PaddedBigBytes(bigint *big.Int, n int) []byte

PaddedBigBytes encodes a big integer as a big-endian byte slice. The length of the slice is at least n bytes.

func PrivateStrToBtcAddress

func PrivateStrToBtcAddress(private string) string

func PrivateStrToByte

func PrivateStrToByte(private string) []byte

func PrivateStrToEcdsa

func PrivateStrToEcdsa(private string) *ecdsa.PrivateKey

func ReadBits

func ReadBits(bigint *big.Int, buf []byte)

ReadBits encodes the absolute value of bigint as big-endian bytes. Callers must ensure that buf has enough space. If buf is too short the result will be incomplete.

func Sha256hash

func Sha256hash(rawdata string) string

func SignTransaction

func SignTransaction(privateKeyStr string, msg string) string

func ToJson

func ToJson(data interface{}) string

func ToText

func ToText(data interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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