argon2

package
v1.245.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabled

func IsEnabled(cfg *Config) bool

IsEnabled the config.

Types

type Config

type Config struct {
	Key  string `yaml:"key,omitempty" json:"key,omitempty" toml:"key,omitempty"`
	Hash string `yaml:"hash,omitempty" json:"hash,omitempty" toml:"hash,omitempty"`
}

Config for argon2.

type Tokenizer

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

Tokenizer for argon2.

func NewTokenizer

func NewTokenizer(cfg *Config, algo argon2.Algo) *Tokenizer

NewTokenizer for token.

func (*Tokenizer) Generate

func (t *Tokenizer) Generate(ctx context.Context) (context.Context, []byte, error)

Generate token from secret file.

func (*Tokenizer) GenerateConfig

func (t *Tokenizer) GenerateConfig() (string, string, error)

GenerateConfig for argon2.

func (*Tokenizer) Verify

func (t *Tokenizer) Verify(ctx context.Context, token []byte) (context.Context, error)

Verify the token with the stored hash.

Jump to

Keyboard shortcuts

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