helper

package
v0.0.0-...-fd201ba Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OSGetwd = os.Getwd
	OSStat  = os.Stat
)

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func ConvertToUpperCase

func ConvertToUpperCase(input string) string

func DecryptSecret

func DecryptSecret(encryptedSecret string, key []byte) ([]byte, error)

DecryptSecret decrypts the encrypted TOTP secret.

func EncryptSecret

func EncryptSecret(secret, key []byte) (string, error)

EncryptSecret encrypts the TOTP secret using AES-256.

func GenerateOTP

func GenerateOTP(digits int8) string

func GetEnvFilePath

func GetEnvFilePath(envFile string) (string, error)

func HashPassword

func HashPassword(password string, cost int) (string, error)

func MakeSQLPlaceholders

func MakeSQLPlaceholders(n uint) []string

func StringPtr

func StringPtr(str string) *string

func ToAESKey

func ToAESKey(key string) []byte

ToAESKey Convert key to 32 bytes using SHA-256

Types

This section is empty.

Jump to

Keyboard shortcuts

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