1
0
mirror of https://github.com/rancher/os.git synced 2025-09-03 07:44:21 +00:00
Files
os/pkg/util/crypt.go
Darren Shepherd 3040e886dc Refactor build
2021-10-02 16:08:48 -07:00

14 lines
303 B
Go

package util
import (
"github.com/tredoe/osutil/user/crypt/common"
"github.com/tredoe/osutil/user/crypt/sha512_crypt"
)
func GetEncryptedPasswd(key string) (string, error) {
c := sha512_crypt.New()
salt := common.Salt{}
saltBytes := salt.Generate(16)
return c.Generate([]byte(key), saltBytes)
}