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 random hash generator to templating engine #117

Open
moenka opened this issue May 23, 2018 · 0 comments
Open

Add random hash generator to templating engine #117

moenka opened this issue May 23, 2018 · 0 comments

Comments

@moenka
Copy link

moenka commented May 23, 2018

Please add a random hash generator for the templating engine since sometimes it's necessary to create hashes for configurations (e.g. Wordpress secret keys). The function name is randomHash.

The generator should take the arguments:

  • mandatory: length of hash
  • optional: regexp of symbols to use for the hash - if this is not set, use all symbols available in utf-8

As a bonus the function must also work with the default function.

Example:
{{ randomHash "32" "[a-zA-Z0-9\[\]\{\}\.]" }}
{{ default .Env.AUTH_KEY randomHash "40" }}

Repository owner deleted a comment from powerman Dec 18, 2024
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

No branches or pull requests

1 participant