strkey

package
v0.0.0-...-8462f89 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2015 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package strkey is an implementation of StrKey, the address scheme for the StellarNetwork.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(expected VersionByte, src string) ([]byte, error)

Decode decodes the provided StrKey into a raw value, checking the checksum and ensuring the expected VersionByte (the version parameter) is the value actually encoded into the provided src string.

func Encode

func Encode(version VersionByte, src []byte) (string, error)

Encode encodes the provided data to a StrKey, using the provided version byte.

func MustDecode

func MustDecode(expected VersionByte, src string) []byte

MustDecode is like Decode, but panics on error

func MustEncode

func MustEncode(version VersionByte, src []byte) string

MustEncode is like Encode, but panics on error

Types

type VersionByte

type VersionByte byte

VersionByte represents one of the possible prefix values for a StrKey base string--the string the when encoded using base32 yields a final StrKey.

const (
	//VersionByteAccountID is the version byte used for encoded stellar addresses
	VersionByteAccountID VersionByte = 6 << 3 // Base32-encodes to 'G...'
	//VersionByteSeed is the version byte used for encoded stellar seed
	VersionByteSeed = 18 << 3 // Base32-encodes to 'S...'
)

Jump to

Keyboard shortcuts

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