Documentation ¶
Index ¶
- Variables
- func Encode(rawPwd []byte, options *Options) ([]byte, []byte)
- func Passwd(rawPwd string) string
- func PasswdOp(rawPwd string, options *Options) string
- func Verify(rawPwd, salt, encodedPwd []byte, options *Options) bool
- func VerifyPasswd(rawPwd string, encoded string) error
- func VerifyPasswdOp(rawPwd string, encoded string, options *Options) error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var WrongFormatPasswd = errors.New("wrong password format")
View Source
var WrongPasswd = errors.New("wrong password")
Functions ¶
func Encode ¶
Encode takes two arguments, a raw password, and a pointer to an Options struct. In order to use default options, pass `nil` as the second argument. It returns the generated salt and encoded supper_key for the user.
func Verify ¶
Verify takes four arguments, the raw password, its generated salt, the encoded password, and a pointer to the Options struct, and returns a boolean value determining whether the password is the correct one or not. Passing `nil` as the last argument resorts to default options.
func VerifyPasswd ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.