auth

package
v0.0.0-...-85469d9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSaltSize = 16
)

The default values for generation

View Source
const (
	SCrypt = 0x1
)

type of crypt

Variables

This section is empty.

Functions

func FindToken

func FindToken(ctx context.Context, token string) bool

FindToken takes HTTP headers and looks for the token and see if exists at the database and enabled

func GenPassword

func GenPassword(cryptoType int, str string, salt []byte) string

GenPassword generate a new password string

func GenSalt

func GenSalt(size int) []byte

GenSalt creates a random crypto based salt, based on a given size. if not given, then DefaultSaltSize is in use

func ValidPassword

func ValidPassword(pass, str string) (bool, error)

ValidPassword Validates a given password with the result of the string

Types

This section is empty.

Jump to

Keyboard shortcuts

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