utils

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 8 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.

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

GenerateRandomString returns a 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.

func GetAESKey

func GetAESKey() (string, error)

func MapToStruct

func MapToStruct(source interface{}, target interface{}) error

func SHA256Hash

func SHA256Hash(payload []byte) string

func ValidateHash

func ValidateHash(password, hash string) bool

Types

type JWTSecret

type JWTSecret struct {
	Type string `json:"type"`
	Key  string `json:"key"`
}

func GetJWTSecret

func GetJWTSecret() (*JWTSecret, error)

Get the JWT key from NHOST variables

Jump to

Keyboard shortcuts

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