| 1234567891011121314 | package commonimport "golang.org/x/crypto/bcrypt"func Password2Hash(password string) (string, error) {	passwordBytes := []byte(password)	hashedPassword, err := bcrypt.GenerateFromPassword(passwordBytes, bcrypt.DefaultCost)	return string(hashedPassword), err}func ValidatePasswordAndHash(password string, hash string) bool {	err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))	return err == nil}
 |