encryption

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The amount of characters generated for random
	// passwords.
	RandomPasswordLength = 24
)

Variables

This section is empty.

Functions

func CreatePassword

func CreatePassword() string

CreatePassword

Creates a random password with a character length of 24.

func GenerateEmailToken

func GenerateEmailToken(email string) (string, error)

GenerateEmailToken

Generates a token based on the email given.

Returns errors.INTERNAL if the bcrypt failed to generate from password.

func GenerateSessionToken

func GenerateSessionToken(email string) string

GenerateSessionToken

Returns a session unique token based on the provided email string.

func GenerateUserToken

func GenerateUserToken(name, email string) string

GenerateUserToken

Generates a new user token based on name & email.

func HashPassword

func HashPassword(password string) (string, error)

HashPassword

Gets the password in byte format and generates a hashed password with the default cost of 10.

Returns errors.INTERNAL if the bcrypt failed to generate from password.

func MD5Hash

func MD5Hash(text string) string

MD5Hash

MD5Hash generates a a random MD5 based on the string given.

Types

This section is empty.

Jump to

Keyboard shortcuts

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