passlib

package
v0.0.0-...-0811b64 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Divider  string = "$"
	DividerB byte   = 0x24
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Algo

type Algo interface {
	Name() string // unique algorithm name
	Encrypt(password string) (string, error)
	Verify(password, hash string) (bool, error)
}

type BcryptAlgo

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

func NewBcrypt

func NewBcrypt(cost int) *BcryptAlgo

func (*BcryptAlgo) Encrypt

func (a *BcryptAlgo) Encrypt(password string) (string, error)

func (*BcryptAlgo) Name

func (a *BcryptAlgo) Name() string

func (*BcryptAlgo) Verify

func (a *BcryptAlgo) Verify(password, hash string) (bool, error)

type Context

type Context struct {
	Default Algo
}

func NewContext

func NewContext() *Context

func (*Context) Encrypt

func (c *Context) Encrypt(password string, _ ...EncOpts) (string, error)

func (*Context) Verify

func (c *Context) Verify(password string, hash string, _ ...VerOpts) (bool, error)

type EncOpts

type EncOpts struct {
}

type VerOpts

type VerOpts struct {
}

Jump to

Keyboard shortcuts

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