Documentation ¶
Overview ¶
Package signature provides helper functions for handling the blockchain signature needs.
Index ¶
- Constants
- func FromAddress(value any, v, r, s *big.Int) (string, error)
- func Hash(value any) string
- func Sign(value any, privateKey *ecdsa.PrivateKey) (v, r, s *big.Int, err error)
- func SignatureString(v, r, s *big.Int) string
- func ToSignatureBytes(v, r, s *big.Int) []byte
- func ToSignatureBytesWithArdanID(v, r, s *big.Int) []byte
- func ToVRSFromHexSignature(sigStr string) (v, r, s *big.Int, err error)
- func VerifySignature(v, r, s *big.Int) error
Constants ¶
View Source
const ZeroHash string = "0x0000000000000000000000000000000000000000000000000000000000000000"
ZeroHash represents a hash code of zeros.
Variables ¶
This section is empty.
Functions ¶
func FromAddress ¶
FromAddress extracts the address for the account that signed the data.
func SignatureString ¶
SignatureString returns the signature as a string.
func ToSignatureBytes ¶
ToSignatureBytes converts the r, s, v values into a slice of bytes with the removal of the ardanID.
func ToSignatureBytesWithArdanID ¶
ToSignatureBytesWithArdanID converts the r, s, v values into a slice of bytes keeping the Ardan id.
func ToVRSFromHexSignature ¶
ToVRSFromHexSignature converts a hex representation of the signature into its R, S and V parts.
func VerifySignature ¶
VerifySignature verifies the signature conforms to our standards.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.