12 lines
234 B
Go
12 lines
234 B
Go
|
package password
|
||
|
|
||
|
import "golang.org/x/crypto/bcrypt"
|
||
|
|
||
|
func HashPassword(password string) (*[]byte, error) {
|
||
|
bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &bytes, err
|
||
|
}
|