MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / hexSha256ToBinaryB64

Function hexSha256ToBinaryB64

pkg/blobmanager/s3/backend.go:280–288  ·  view source on GitHub ↗

decode the hex string into a []byte slice. base64 encode the result

(hexString string)

Source from the content-addressed store, hash-verified

278// decode the hex string into a []byte slice.
279// base64 encode the result
280func 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
290func resourceName(digest string) string {
291 return fmt.Sprintf("sha256:%s", digest)

Callers 2

DescribeMethod · 0.70

Calls

no outgoing calls

Tested by 1