utils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils contains utility functions for the wallet like hashes and crypto functions

Index

Constants

View Source
const (
	// XpubKeyLength is the length of an xPub string key
	XpubKeyLength = 111

	// ChainInternal internal chain num
	ChainInternal = uint32(1)

	// ChainExternal external chain num
	ChainExternal = uint32(0)

	// MaxInt32 max integer for int32
	MaxInt32 = int64(1<<(32-1) - 1)
)

Variables

This section is empty.

Functions

func DeriveChildKeyFromHex

func DeriveChildKeyFromHex(hdKey *bip32.ExtendedKey, hexHash string) (*bip32.ExtendedKey, error)

DeriveChildKeyFromHex derive the child extended key from the hex string

func GetChildNumsFromHex

func GetChildNumsFromHex(hexHash string) ([]uint32, error)

GetChildNumsFromHex get an array of uint32 numbers from the hex string

func Hash

func Hash(data string) string

Hash returns the sha256 hash of the data string

func RandomHex

func RandomHex(n int) (string, error)

RandomHex returns a random hex string and error

Types

This section is empty.

Jump to

Keyboard shortcuts

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