hashers

package
v0.0.0-...-96c9e65 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2013 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	MaxSaltSize  = 12
)
View Source
const (
	DefaultIterations = 12000
)

Variables

View Source
var (
	Algorithm string
)

Functions

func CheckPassword

func CheckPassword(rawPass, encode string) bool

func MakePassword

func MakePassword(rawPass string) string

func RandomString

func RandomString() string

Types

type BasePasswordHash

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

type BcryptPasswordHash

type BcryptPasswordHash struct {
	*BasePasswordHash
}

func NewBcryptPasswordHash

func NewBcryptPasswordHash() *BcryptPasswordHash

func NewBcryptSHA256PasswordHash

func NewBcryptSHA256PasswordHash() *BcryptPasswordHash

func (*BcryptPasswordHash) Encode

func (this *BcryptPasswordHash) Encode(password string) (string, error)

func (*BcryptPasswordHash) Verify

func (this *BcryptPasswordHash) Verify(password, encode string) bool

type PBKDF2PasswordHash

type PBKDF2PasswordHash struct {
	*BasePasswordHash
	// contains filtered or unexported fields
}

func NewPBKDF2PasswordHash

func NewPBKDF2PasswordHash() *PBKDF2PasswordHash

func NewPBKDF2SHA1PasswordHash

func NewPBKDF2SHA1PasswordHash() *PBKDF2PasswordHash

func (*PBKDF2PasswordHash) Encode

func (this *PBKDF2PasswordHash) Encode(password string) (string, error)

func (*PBKDF2PasswordHash) Verify

func (this *PBKDF2PasswordHash) Verify(password, encode string) bool

type PasswordHasher

type PasswordHasher interface {
	Verify(password, encode string) bool
	Encode(password string) (string, error)
}

Jump to

Keyboard shortcuts

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