Documentation ¶
Overview ¶
Package utils contains functions for hashing, signing and verifying data
Index ¶
- func BoolToString(input bool) string
- func BuildSecret(privateKey *btcec.PrivateKey, walletID, coin, netShort string) (string, error)
- func Hash160(data []byte) ([]byte, error)
- func HashMessage(input []byte) []byte
- func ParseSecret(secret string) (*btcec.PrivateKey, string, string, string, error)
- func Reverse(data []byte) []byte
- func Sha256(data []byte) []byte
- func SignMessage(data []byte, privateKey *btcec.PrivateKey) ([]byte, error)
- func ToBytes(input string) ([]byte, error)
- func ToHex(input []byte) string
- func VerifyMessage(data, sig []byte, publicKey *btcec.PublicKey) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolToString ¶
BoolToString converts bool to int represented in string
func BuildSecret ¶
func BuildSecret(privateKey *btcec.PrivateKey, walletID, coin, netShort string) (string, error)
BuildSecret derives invitation secret for multi-signature wallets
func Hash160 ¶
Hash160 performs the same operations as OP_HASH160 in Bitcoin Script It hashes the given data first with SHA256, then RIPEMD160
func HashMessage ¶
HashMessage calculates double sha-256 and returns reverse bytes
func ParseSecret ¶
ParseSecret parses shared wallet secret
func SignMessage ¶
func SignMessage(data []byte, privateKey *btcec.PrivateKey) ([]byte, error)
SignMessage takes message hash and generates ECDSA signature with private key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.