Documentation
¶
Index ¶
- func Decode(s string) uint64
- func DecodeToBytes(b string) []byte
- func Encode(value uint64) string
- func EncodeBytes(b []byte) string
- func EncodeBytesAsBytes(b []byte) []byte
- func GenerateKeypair() (PublicKeyStr, PrivateKeyStr, error)
- type PrivateKey
- type PrivateKeyStr
- type PublicKey
- type PublicKeyStr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeToBytes ¶
DecodeToBytes decodes a base36 string to a byte slice, using alphabet.
func EncodeBytes ¶
EncodeBytes encodes a byte slice to base36 string.
func EncodeBytesAsBytes ¶
EncodeBytesAsBytes encodes a byte slice to base36.
func GenerateKeypair ¶ added in v0.1.0
func GenerateKeypair() (PublicKeyStr, PrivateKeyStr, error)
GenerateKeypair generates a public and private keypair string
Types ¶
type PrivateKey ¶
type PrivateKey struct {
D []byte
}
PrivateKey is a bytestream of data not converted to anything
func GenerateKey ¶
func GenerateKey() (*PrivateKey, error)
GenerateKey generate a new random private key
func PrivateKeyFromString ¶
func PrivateKeyFromString(private string) (*PrivateKey, error)
PrivateKeyFromString grabs a private key string and gives out a privatekey object
func (*PrivateKey) Decrypt ¶ added in v0.1.0
func (private *PrivateKey) Decrypt(data []byte) (decrypted []byte, err error)
Decrypt will provide a decryption mechanism for an arbitrary bytestream
func (*PrivateKey) Encrypt ¶ added in v0.1.0
func (private *PrivateKey) Encrypt(public *PublicKey, data []byte) (encrypted []byte, err error)
Encrypt will provide a encryption mechanism for an arbitrary bytestream
func (PrivateKey) GetPublicKey ¶
func (private PrivateKey) GetPublicKey() PublicKey
GetPublicKey returns a PublicKey object from the key
func (PrivateKey) String ¶
func (private PrivateKey) String() PrivateKeyStr
String marshaller for private key
type PrivateKeyStr ¶ added in v0.1.0
type PrivateKeyStr string
type PublicKey ¶
PublicKey has the curve and the X,Y.
func GetPublicKeyFromMessage ¶
GetPublicKeyFromMessage is a helper function to extract first 32 bytes from a long message, and provide the sender public key of it
func PublicKeyFromString ¶
func PublicKeyFromString(public PublicKeyStr) (*PublicKey, error)
PublicKeyFromString grabs a public key string and gives out a publickey object
func (PublicKey) String ¶
func (key PublicKey) String() PublicKeyStr
String marshaller for public key
type PublicKeyStr ¶ added in v0.1.0
type PublicKeyStr string