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)
| 371 | // returns the recorded checksum in base64 form; comparing it to a hex |
| 372 | // digest needs this conversion. |
| 373 | func 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 |