Skip to content

Instantly share code, notes, and snippets.

@jeffreyalles
Forked from benwalio/uuid.jinja
Created May 15, 2024 13:00
Show Gist options
  • Save jeffreyalles/54738abf0eb1d8d196410c3b39847adc to your computer and use it in GitHub Desktop.
Save jeffreyalles/54738abf0eb1d8d196410c3b39847adc to your computer and use it in GitHub Desktop.
create a basic uuid using jinja2
{%- set ns = namespace(uuid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') %}
{%- set ns.new_uuid = '' %}
{%- for x in ns.uuid %}
{%- set ns.new_uuid = [ns.new_uuid,(x | replace('x', [0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f'] | random ))] | join %}
{%- endfor %}
{{ ns.new_uuid }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment