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

Function hexSha256ToBinaryB64

pkg/blobmanager/s3accesspoint/backend.go:373–379  ·  view source on GitHub ↗

hexSha256ToBinaryB64 decodes the hex sha and re-encodes as base64. S3 returns the recorded checksum in base64 form; comparing it to a hex digest needs this conversion.

(hexString string)

Source from the content-addressed store, hash-verified

371// returns the recorded checksum in base64 form; comparing it to a hex
372// digest needs this conversion.
373func hexSha256ToBinaryB64(hexString string) string {
374 decoded, err := hex.DecodeString(hexString)
375 if err != nil {
376 return ""
377 }
378 return base64.StdEncoding.EncodeToString(decoded)
379}
380
381// fakeWriterAt wraps an io.Writer so the SDK's WriterAt-shaped
382// downloader can be driven by a regular writer. Safe only when

Callers 1

DescribeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected