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 MakePassword ¶
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
Click to show internal directories.
Click to hide internal directories.