consensus

package
v0.0.7-beta Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeProofOfWork

func ComputeProofOfWork(peerId string, difficulty int) (string, error)

func GenerateJWTToken

func GenerateJWTToken(peerId string) (string, error)

func GeneratePoW

func GeneratePoW(peerId string) string

func SignData

func SignData(privKey crypto.PrivKey, data []byte) ([]byte, error)

SignData signs the data using the provided private key and returns the signature.

func VerifySignature

func VerifySignature(pubKey crypto.PubKey, data []byte, signatureHex string) (bool, error)

VerifySignature verifies the signature of the data using the signers public key, the data that was signed, and the signature.

Types

This section is empty.

Jump to

Keyboard shortcuts

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