Example #1
0
// Expects address in base58 form
func NewRegularKeyFromAddress(s string) (*RegularKey, error) {
	hash, err := crypto.NewRippleHashCheck(s, crypto.RIPPLE_ACCOUNT_ID)
	if err != nil {
		return nil, err
	}
	var regKey RegularKey
	copy(regKey[:], hash.Payload())
	return &regKey, nil
}
Example #2
0
// Expects address in base58 form
func NewAccountFromAddress(s string) (*Account, error) {
	hash, err := crypto.NewRippleHashCheck(s, crypto.RIPPLE_ACCOUNT_ID)
	if err != nil {
		return nil, err
	}
	var account Account
	copy(account[:], hash.Payload())
	return &account, nil
}