utils

package module
v0.0.0-...-cc6bba2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 17 Imported by: 10

README

Utils

More general utilities that are used by other modules.

ed25519 is a modified version of the crypto/ed25519 standard library that uses blake2b instead of sha512.

Documentation

Index

Constants

View Source
const EncodeNano = "13456789abcdefghijkmnopqrstuwxyz"

nano uses a non-standard base32 character set.

Variables

Functions

func AddressToPub

func AddressToPub(account string, banano bool) (public_key []byte, err error)

func GenerateSeed

func GenerateSeed(rand io.Reader) (string, error)

Generates a seed, if rand is nil will use crypto/rand to generate secure seeds

func GetAddressChecksum

func GetAddressChecksum(pub ed25519.PublicKey) []byte

func GetEnv

func GetEnv(key string, fallback string) string

func GetPippinConfigurationRoot

func GetPippinConfigurationRoot() (string, error)

func KeypairFromSeed

func KeypairFromSeed(seed string, index uint32) (ed25519.PublicKey, ed25519.PrivateKey, error)

Generate a keypair from a seed at specified index

func PubKeyToAddress

func PubKeyToAddress(pub ed25519.PublicKey, banano bool) string

func Reversed

func Reversed(str []byte) (result []byte)

func ToBool

func ToBool(val interface{}) (bool, error)

func ToInt

func ToInt(val interface{}) (int, error)

func Validate64HexHash

func Validate64HexHash(hash string) bool

Types

type AESCrypt

type AESCrypt struct {
	SecretKey string
}

func NewAesCrypt

func NewAesCrypt(key string) *AESCrypt

func (*AESCrypt) Decrypt

func (a *AESCrypt) Decrypt(encryptedString string) (string, error)

func (*AESCrypt) Encrypt

func (a *AESCrypt) Encrypt(input string) (string, error)

Directories

Path Synopsis
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.

Jump to

Keyboard shortcuts

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