decode the hex string into a []byte slice. base64 encode the result
(hexString string)
| 278 | // decode the hex string into a []byte slice. |
| 279 | // base64 encode the result |
| 280 | func hexSha256ToBinaryB64(hexString string) string { |
| 281 | // Decode the hex string into a []byte slice. |
| 282 | decoded, err := hex.DecodeString(hexString) |
| 283 | if err != nil { |
| 284 | return "" |
| 285 | } |
| 286 | |
| 287 | return base64.StdEncoding.EncodeToString(decoded) |
| 288 | } |
| 289 | |
| 290 | func resourceName(digest string) string { |
| 291 | return fmt.Sprintf("sha256:%s", digest) |
no outgoing calls