Skip to content

Use Spanner's base64 encoding/decoding in storage #6946

@coryan

Description

@coryan

We have two sets of Base64 encoding/decoding functions, some in Spanner:

StatusOr<spanner::Bytes> BytesFromBase64(std::string input);
std::string BytesToBase64(spanner::Bytes b);

and some in Storage:

/**
* Decodes a Base64-encoded string.
*/
std::vector<std::uint8_t> Base64Decode(std::string const& str);
/**
* Encodes a string using Base64.
*/
std::string Base64Encode(std::string const& str);

We should refactor the implementation in spanner to google/cloud/internal and use those in the storage library. Using OpenSSL for this is too complicated, and requires error handling for the OpenSSL abstractions.

I think this will remove some of the exceptions mentioned in #6933

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions