phcParamsToMap parses the parameters in the string s and returns them in a map of keys and values.
(s string)
| 25 | // phcParamsToMap parses the parameters in the string s and returns them in a |
| 26 | // map of keys and values. |
| 27 | func 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. |
| 42 | func phcEncode(identifier, params string, salt, hash []byte) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…