summary refs log blame commit diff stats
path: root/auth/hashpass.go
blob: 4e5041a707ee719db8c455378589fe44121b0d26 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                       
package auth

import (
	"golang.org/x/crypto/bcrypt"
)

// hashPass takes a string as input and returns the hash of the
// password.
func hashPass(password string) (string, error) {
	// 10 is the default cost.
	bytes, err := bcrypt.GenerateFromPassword([]byte(password), 10)
	return string(bytes), err
}