(key string)
| 139 | } |
| 140 | |
| 141 | func encodeBase64ToHex(key string) (string, error) { |
| 142 | decoded, err := base64.StdEncoding.DecodeString(key) |
| 143 | if err != nil { |
| 144 | return "", errors.New("invalid base64 string: " + key) |
| 145 | } |
| 146 | if len(decoded) != 32 { |
| 147 | return "", errors.New("key should be 32 bytes: " + key) |
| 148 | } |
| 149 | return hex.EncodeToString(decoded), nil |
| 150 | } |
| 151 | |
| 152 | func parseNetIP(section *ini.Section, keyName string) ([]netip.Addr, error) { |
| 153 | key, err := parseString(section, keyName) |
no outgoing calls
no test coverage detected