authenticator

package
v0.0.0-...-2694588 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(hashed, password string) error

func Decrypt

func Decrypt(key, ct string) (string, error)

func Encrypt

func Encrypt(key, pt string) (string, error)

func Hash

func Hash(password string) (string, error)

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func New

func New(secret string) Authenticator

func (*Authenticator) Parse

func (a *Authenticator) Parse(tokenString string) (primitive.ObjectID, string, error)

func (*Authenticator) Sign

func (a *Authenticator) Sign(U_ID primitive.ObjectID, username string) (string, time.Time, error)

Jump to

Keyboard shortcuts

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