1
0
mirror of https://github.com/rancher/os.git synced 2025-09-07 17:54:57 +00:00

Refactor build

This commit is contained in:
Darren Shepherd
2021-08-31 11:14:03 -07:00
parent e38bab4144
commit 3040e886dc
56 changed files with 2098 additions and 292 deletions

13
pkg/util/crypt.go Normal file
View File

@@ -0,0 +1,13 @@
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)
}