Add b64url_digest method for URL-safe base64 digests#8
Draft
toddr-bot wants to merge 22 commits into
Draft
Conversation
Drop use vars
- meta-spec 2 resources format - dependencies are static, set dynamic_config 0 - EUMM will set configure_requires on itself - Test::More only used in tests - boilerplate to clean out unsupported keys if installed with old EUMM
Makefile.PL - use meta-spec 2, fix prereqs, compatibility with old EUMM
base.t, file.t: unlink temporary files created during testing
Ignore common temp files in repo.
Adds b64url_digest() to Digest::base, returning the digest using the URL-safe base64 alphabet (- instead of +, _ instead of /) without padding, per RFC 4648 section 5. This is a convenience shortcut for the common pattern of encoding a digest for use in URLs and filenames. Closes #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Companion to b64url_digest — provides the same URL-safe base64 output format through the file convenience API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
b64url_digest()method toDigest::base— URL-safe base64 encoding of digests per RFC 4648 §5.Why
Resolves #2. Embedding digests in URLs currently requires
encode_base64url($ctx->digest)with a direct MIME::Base64 dependency at the call site. A first-class method completes the digest output format family (binary, hex, base64, base64url).How
Reuses
b64digest()and appliestr[+/][-_]— no new MIME::Base64 version requirement, works on Perl 5.006+.Testing
t/base.t: verifies no-op on digests without+/, and explicit+→-and/→_translation using a binary digest mock.🤖 Generated with Claude Code