mirror of
https://github.com/rancher/os.git
synced 2025-09-07 17:54:57 +00:00
Refactor build
This commit is contained in:
13
pkg/util/crypt.go
Normal file
13
pkg/util/crypt.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user