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

Add Base 64 encode and decode filters #763

Merged
merged 3 commits into from
Oct 6, 2021
Merged

Add Base 64 encode and decode filters #763

merged 3 commits into from
Oct 6, 2021

Conversation

jasmith-hs
Copy link
Contributor

Adds 2 new filters:

  • b64encode
  • b64decode

Each of them default to using UTF-8, but you can specify the charset as one of:

US_ASCII
ISO_8859_1
UTF_8
UTF_16BE
UTF_16LE
UTF_16

(If running on a machine that supports more charsets, you can use one of those too).
These filters are both supported in ansible

For #743

Copy link
Contributor

@jmaroeder jmaroeder left a comment

Choose a reason for hiding this comment

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

Cool! Just a couple missing snippets that I see

)
},
snippets = {
@JinjavaSnippet(code = "{% set my_number = -53 %}\n" + "{{ my_number|abs }}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you copied this over from AbsFilter - should probably update it to use b64decode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, thanks for catching this!

)
},
snippets = {
@JinjavaSnippet(code = "{% set my_number = -53 %}\n" + "{{ my_number|abs }}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update this to use b64encode

Copy link
Contributor

@Joeoh Joeoh left a comment

Choose a reason for hiding this comment

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

Thanks for adding!

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

Successfully merging this pull request may close these issues.

3 participants