Documentation
¶
Index ¶
- Constants
- Variables
- func Base58Decode(b, alphabet string) ([]byte, error)
- func Base58Encode(b []byte, alphabet string) string
- func DecodeSeed(seed string) (string, []byte, error)
- func DeriveKeypair(seed string) ([]byte, []byte, error)
- func DeriveKeypairEd25519(entropy []byte) ([]byte, []byte, error)
- func DeriveKeypairSecp256k1(entropy []byte, sequence *uint32) ([]byte, []byte, error)
- func DoubleSha256(b []byte) []byte
- func GenerateEntropy() ([]byte, error)
- func GenerateKeyPair(algorithm string) (string, []byte, []byte, error)
- func GenerateSeed(algorithm string) (string, error)
- func GenerateSeedEd25519(entropy []byte) (string, error)
- func GenerateSeedSecp256k1(entropy []byte) (string, error)
- func Sha256(b []byte) []byte
- func Sha256RipeMD160(b []byte) []byte
- func Sha512Half(b []byte) []byte
Constants ¶
View Source
const ( ENTROPY_LENGTH = 16 ALGORITHM_ED25519 = "ed25519" ALGORITHM_SECP256K1 = "secp256k1" )
View Source
const (
// ALPHABET is the modified base58 alphabet used by XRPL.
ALPHABET = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"
)
View Source
const (
ED25519_PRIVATE_KEY_PREFIX = 0xED
)
View Source
const (
SECP256K1_PRIVATE_KEY_PREFIX = 0x00
)
Variables ¶
View Source
var (
ED25519_SEED_PREFIX = []byte{0x01, 0xe1, 0x4b}
)
View Source
var (
SECP256K1_SEED_PREFIX = []byte{0x21}
)
Functions ¶
func Base58Decode ¶
Base58Decode decodes a modified base58 string to a byte slice and checks checksum.
func Base58Encode ¶
Base58Encode encodes a byte slice to a modified base58 string.
func DeriveKeypairSecp256k1 ¶
func DoubleSha256 ¶
Returns bytes of a SHA256 double hash of the input bytes
func GenerateEntropy ¶
func GenerateSeed ¶
func GenerateSeedEd25519 ¶
func GenerateSeedSecp256k1 ¶
func Sha256RipeMD160 ¶
Returns bytes of a SHA256 ripemd160 of the input bytes
func Sha512Half ¶
Returns first 32 bytes of a SHA512 of the input bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.