Documentation ¶
Index ¶
- Constants
- func Base58Decode(b, alphabet string) ([]byte, error)
- func Base58Encode(b []byte, alphabet string) string
- func DoubleSha256(b []byte) []byte
- func NewECDSAKey(seed []byte) (*ecdsaKey, error)
- func NewEd25519Key(seed []byte) (*ed25519key, error)
- func Sha256RipeMD160(b []byte) []byte
- func Sha512(b []byte) []byte
- func Sha512Half(b []byte) []byte
- func Sha512Quarter(b []byte) []byte
- func Sign(privateKey, hash, msg []byte) ([]byte, error)
- func Verify(publicKey, hash, msg, signature []byte) (bool, error)
- type Hash
- func AccountId(key Key, sequence *uint32) (Hash, error)
- func AccountPrivateKey(key Key, sequence *uint32) (Hash, error)
- func AccountPublicKey(key Key, sequence *uint32) (Hash, error)
- func GenerateFamilySeed(password string) (Hash, error)
- func NewAccountId(b []byte) (Hash, error)
- func NewAccountPrivateKey(b []byte) (Hash, error)
- func NewAccountPublicKey(b []byte) (Hash, error)
- func NewFamilySeed(b []byte) (Hash, error)
- func NewNodePrivateKey(b []byte) (Hash, error)
- func NewNodePublicKey(b []byte) (Hash, error)
- func NewRippleHash(s string) (Hash, error)
- func NewRippleHashCheck(s string, version HashVersion) (Hash, error)
- func NodePrivateKey(key Key) (Hash, error)
- func NodePublicKey(key Key) (Hash, error)
- type HashVersion
- type Key
Constants ¶
View Source
const ( ACCOUNT_ZERO = "rrrrrrrrrrrrrrrrrrrrrhoLvTp" ACCOUNT_ONE = "rrrrrrrrrrrrrrrrrrrrBZbvji" NaN = "rrrrrrrrrrrrrrrrrrrn5RM1rHd" ROOT = "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" )
Variables ¶
This section is empty.
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 DoubleSha256 ¶
func NewECDSAKey ¶
If seed is nil, generate a random one
func NewEd25519Key ¶
func Sha256RipeMD160 ¶
func Sha512Half ¶
Returns first 32 bytes of a SHA512 of the input bytes
func Sha512Quarter ¶
Returns first 16 bytes of a SHA512 of the input bytes
Types ¶
type Hash ¶
type Hash interface { Version() HashVersion Payload() []byte PayloadTrimmed() []byte Value() *big.Int String() string Clone() Hash MarshalText() ([]byte, error) }
func GenerateFamilySeed ¶
func NewAccountId ¶
func NewAccountPrivateKey ¶
func NewAccountPublicKey ¶
func NewFamilySeed ¶
func NewNodePrivateKey ¶
func NewNodePublicKey ¶
func NewRippleHash ¶
func NewRippleHashCheck ¶
func NewRippleHashCheck(s string, version HashVersion) (Hash, error)
Checks hash matches expected version
func NodePrivateKey ¶
func NodePublicKey ¶
type HashVersion ¶
type HashVersion byte
const ( ALPHABET = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz" RIPPLE_ACCOUNT_ID HashVersion = 0 RIPPLE_NODE_PUBLIC HashVersion = 28 RIPPLE_NODE_PRIVATE HashVersion = 32 RIPPLE_FAMILY_SEED HashVersion = 33 RIPPLE_ACCOUNT_PRIVATE HashVersion = 34 RIPPLE_ACCOUNT_PUBLIC HashVersion = 35 )
Click to show internal directories.
Click to hide internal directories.