secure

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service holds security related methods

func New

func New(minPWStr int, h hash.Hash) *Service

New initalizes security service

func (*Service) Hash

func (*Service) Hash(password string) string

Hash hashes the password using bcrypt

func (*Service) HashMatchesPassword

func (*Service) HashMatchesPassword(hash, password string) bool

HashMatchesPassword matches hash with password. Returns true if hash and password match.

func (*Service) Password

func (s *Service) Password(pass string, inputs ...string) bool

Password checks whether password is secure enough using zxcvbn library

func (*Service) Token

func (s *Service) Token(str string) string

Token generates new unique token

Jump to

Keyboard shortcuts

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