crypto

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue. (Taken from https://flaviocopes.com/go-random/)

func GenerateRandomString

func GenerateRandomString(s int) (string, error)

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue. (Taken from https://flaviocopes.com/go-random/)

func HashAndSalt

func HashAndSalt(password string) string

Hash and salt a string (to save in the db)

func IsHashedPasswordEqualWithPlainPassword

func IsHashedPasswordEqualWithPlainPassword(hashedPwd string, plainPwd string) bool

Compare the hashed password form the database with the provided

Types

This section is empty.

Jump to

Keyboard shortcuts

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