enc

package
v0.0.0-...-9192568 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecryption = errors.New("enc: failed to decrypt data")
	ErrDataLength = errors.New("enc: the data length is too short for encryption")
)
View Source
var ErrPasswordLength = errors.New("enc: the password is missing")

Functions

func DecryptData

func DecryptData(data []byte) ([]byte, error)

DecryptData transforms an encrypted slice of bytes into an original one.

func EncryptData

func EncryptData(data []byte) ([]byte, error)

EncryptData transforms an original slice of bytes into an encoded one.

func HashPassword

func HashPassword(s string) (string, error)

HashPassword encodes an original password string.

func VerifyPassword

func VerifyPassword(pwd, hash string) bool

VerifyPassword compares an encrypted password with a plain one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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