Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a base64 primitive #276

Open
shs96c opened this issue Apr 17, 2024 · 2 comments
Open

Provide a base64 primitive #276

shs96c opened this issue Apr 17, 2024 · 2 comments

Comments

@shs96c
Copy link

shs96c commented Apr 17, 2024

When calculating things like integrity hashes (used by recent Bazel releases), it's helpful to be able to base64 encode and decode values. Starlark does not offer a mechanism to do this natively, though it may be possible to write one in pure starlark. Having a native implementation would be significantly faster (as we saw with JSON processing)

@shs96c
Copy link
Author

shs96c commented Apr 17, 2024

One such pure Starlark implementation is here: https://github.com/aspect-build/bazel-lib/blob/main/lib/private/base64.bzl

@brandjon
Copy link
Member

It seems like this would be supported by a string <-> bytes encoding/decoding API. So I think this is blocked on finalizing bytes support in the spec (the list of methods, which are currently TODOs).

One relevant question is whether base64 would be listed in the spec as a required supported encoding for any implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants