codejanovic / go-password

go password package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status License

go-password

this projects provides a very simple password interface and different password implementations.

Every implementation will return a Password interface:

type Password interface {
	GetHash() string
	GetSalt() string
}

Supported implementations ...

Bcrypt

Either create a new Password with a generated (UUID) salt:

func NewBcryptPassword(plainPassword string) (Password, error) {
	...
}

or create a new Password with a given salt of your choice:

func NewBcryptPasswordWithGivenSalt(plainPassword string, salt string) (Password, error) {
	...
}

About

go password package

License:MIT License


Languages

Language:Go 100.0%