mutil

package
v0.0.0-...-4adfca9 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: AGPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase64

func DecodeBase64(dataBase64 []byte) ([]byte, error)

func DoesExist

func DoesExist(filePath string) bool

func EncodeBase64

func EncodeBase64(data []byte) []byte

func Get32BitMaskFromCIDR

func Get32BitMaskFromCIDR(netmask int) string

** helper function for converting a integer such as 24 net-mask to its 32-bit ** equivalent such as 255.255.255.0

func GetInfohashByPubKey

func GetInfohashByPubKey(pub *rsa.PublicKey) (string, error)

func GetMutualMPipePort

func GetMutualMPipePort(pubKeyHash string, peerPubKeyHash string) int

Return an integer that is deterministically calculated from two pubkeyhashes The resulting integer is used as the mpipe port between the two pubkeyhash owners as a form of psuedo port negotiation

func LoadKey

func LoadKey(privateKeyPath string) *rsa.PrivateKey

func NewAesCrypter

func NewAesCrypter(key []byte) *aesCrypter

Types

type SymmetricCrypter

type SymmetricCrypter interface {
	Encrypt(plaintext []byte) (ciphertext []byte, err error)
	Decrypt(ciphertext []byte) (plaintext []byte, err error)
}

Jump to

Keyboard shortcuts

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