utils

package
v0.0.0-...-cb6319d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB ...

Functions

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd string) error

ComparePasswords compares a hash with a password

func GenerateRandomBytes

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

GenerateRandomBytes securely generates random bytes.

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

GenerateRandomString returns a base64 encoded securely generated random string.

func GetDB

func GetDB() *gorm.DB

GetDB ...

func HashAndSalt

func HashAndSalt(pwd []byte) string

HashAndSalt hashes and salts a password

func InitDB

func InitDB() *gorm.DB

InitDB ...

func ParseUserDBError

func ParseUserDBError(err error) string

ParseUserDBError parses the error returned from Postgres when a unique kep exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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