MCPcopy Index your code
hub / github.com/smallstep/cli / phcParamsToMap

Function phcParamsToMap

internal/kdf/phc.go:27–39  ·  view source on GitHub ↗

phcParamsToMap parses the parameters in the string s and returns them in a map of keys and values.

(s string)

Source from the content-addressed store, hash-verified

25// phcParamsToMap parses the parameters in the string s and returns them in a
26// map of keys and values.
27func phcParamsToMap(s string) map[string]string {
28 parameters := strings.Split(s, ",")
29 m := make(map[string]string, len(parameters))
30 for _, p := range parameters {
31 subs := strings.SplitN(p, "=", 2)
32 if len(subs) == 2 {
33 m[subs[0]] = subs[1]
34 } else {
35 m[subs[0]] = ""
36 }
37 }
38 return m
39}
40
41// phcEncode creates a string using the PHC format.
42func phcEncode(identifier, params string, salt, hash []byte) string {

Callers 3

newScryptParamsFunction · 0.85
phcDecodeFunction · 0.85
newArgon2ParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…