functions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hash string) error

Called in the auth controller. Is used to check if the password is correct with the user's password in the database.

func Contains

func Contains(s []string, str string) bool

Récupère le contenu d'une string donnée dans un tableau de string

func Decrypt

func Decrypt(data []byte, passphrase string) ([]byte, error)

Decrypt Decrypte une chaine

func DecryptFile

func DecryptFile(filename string, passphrase string, decrypt bool) ([]byte, error)

DecryptFile Decrypte un fichier

func Encrypt

func Encrypt(data []byte, passphrase string) ([]byte, error)

Encrypt Crypte une chaine

func EncryptFile

func EncryptFile(filename string, data []byte, passphrase string) error

EncryptFile Encrypte un fichier

func GeneratePassword

func GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int) string

GeneratePassword ...

func GetPassphrase

func GetPassphrase() string

GetPassphrase Récupération de la passphrase

func HashAndSalt

func HashAndSalt(pwd string) ([]byte, error)

HashAndSalt ...

func IsEmailValid

func IsEmailValid(s string) bool

IsEmailValid checks if the email provided passes the required structure and length.

func IsLenStringValid

func IsLenStringValid(s string) bool

IsLenStringValid check lenght of string

func IsNameValid

func IsNameValid(s string) bool

IsNameValid checks if the name provided respects the required elements

func IsPasswordValid

func IsPasswordValid(s string, i int) bool

IsPasswordValid checks if the password provided respects the required elements

func IsUserNameValid

func IsUserNameValid(s string) bool

IsUserNameValid checks if the name provided respects the required elements

func IsValidURL

func IsValidURL(s string) bool

IsValidURL Check URL

func NewUUID

func NewUUID() string

NewUUID ...

func RemoveDuplicate

func RemoveDuplicate(xs *[]string)

RemoveDuplicate : Supression de doublons dans un tableau

func Round

func Round(val float64, roundOn float64, places int) (newVal float64)

Round arrondi

func SetPassphrase

func SetPassphrase(newpassphrase string)

SetPassphrase alimentation de la passphrase

Types

This section is empty.

Jump to

Keyboard shortcuts

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