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

added unpadded base64 builtins #52

Merged
merged 2 commits into from
Nov 24, 2023
Merged

added unpadded base64 builtins #52

merged 2 commits into from
Nov 24, 2023

Conversation

manego
Copy link
Contributor

@manego manego commented Nov 23, 2023

Switched current base64 and base64url behavior to include padding and added additional base64Unpadded and base64urlUnpadded builtins to still allow unpadded base64 encoding.

@manego manego added the enhancement New feature or request label Nov 23, 2023
@manego manego requested a review from zekroTJA November 23, 2023 15:25
@manego manego linked an issue Nov 23, 2023 that may be closed by this pull request
@zekroTJA zekroTJA changed the base branch from main to dev November 23, 2023 15:46
Copy link
Member

@zekroTJA zekroTJA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I would just suggest some naming changes.

For better consistency across the built-in functions, I would rename the following builtin functions.

  • base64urlbase64Url
  • base64urlUnpaddedbase64UrlUnpadded

"isset": builtin_isset,
"json": builtin_json,
"base64": builtin_base64,
"base64url": builtin_base64Url,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have clearer consistency across bult-in functions, I would re-name this to base64Url.

"base64": builtin_base64,
"base64url": builtin_base64Url,
"base64Unpadded": builtin_base64Unpadded,
"base64urlUnpadded": builtin_base64UrlUnpadded,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same to the change above, I would re-name this to base64UrlUnpadded for better consistency.

@manego manego requested a review from zekroTJA November 24, 2023 07:08
@zekroTJA zekroTJA merged commit 5d23358 into dev Nov 24, 2023
@manego manego deleted the am/base64 branch November 24, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for non-raw std encoding in builtin base64 template functions
2 participants