hash

package
v0.0.0-...-9be93d0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Binding = "cicada.hash"
View Source
const (
	DriverBcrypt string = "bcrypt"
)

Variables

This section is empty.

Functions

func NewApplication

func NewApplication(config config.Config) hash.Hash

Types

type Application

type Application struct {
}

type Argon2id

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

func NewArgon2id

func NewArgon2id(config config.Config) *Argon2id

NewArgon2id returns a new Argon2id hasher.

func (*Argon2id) Check

func (a *Argon2id) Check(value, hash string) bool

func (*Argon2id) Make

func (a *Argon2id) Make(value string) (string, error)

func (*Argon2id) NeedsRehash

func (a *Argon2id) NeedsRehash(hash string) bool

type Bcrypt

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

func NewBcrypt

func NewBcrypt(config config.Config) *Bcrypt

NewBcrypt returns a new Bcrypt hasher.

func (*Bcrypt) Check

func (b *Bcrypt) Check(value, hash string) bool

Check checks if the given string matches the given hash.

func (*Bcrypt) Make

func (b *Bcrypt) Make(value string) (string, error)

Make returns the hashed value of the given string.

func (*Bcrypt) NeedsRehash

func (b *Bcrypt) NeedsRehash(hash string) bool

NeedsRehash checks if the given hash needs to be rehashed.

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (hash *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (hash *ServiceProvider) Register(app foundation.Application)

Jump to

Keyboard shortcuts

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