github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/dashboard/api/pkg/model/utils.go (about)

     1  package model
     2  
     3  import (
     4  	"golang.org/x/crypto/bcrypt"
     5  )
     6  
     7  func hashPassword(password string) (string, error) {
     8  	hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.MinCost)
     9  	if err != nil {
    10  		return "", err
    11  	}
    12  	return string(hash), nil
    13  }