community.general.hashids_encode (8.5.0) — filter

Encodes YouTube-like hashes from a sequence of integers

| "added in version" 3.0.0 of community.general"

Authors: Andrew Pantuso (@Ajpantuso)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Encodes YouTube-like hashes from a sequence of integers.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Convert list of integers to hash
  ansible.builtin.debug:
    msg: "{{ [1, 2, 3] | community.general.hashids_encode }}"

Inputs

    
salt:
    default: excel
    description:
    - String to use as salt when hashing.
    type: str

_input:
    description: A list of integers.
    elements: integer
    required: true
    type: list

alphabet:
    description:
    - String of 16 or more unique characters to produce a hash.
    elements: str
    type: list

min_length:
    description:
    - Minimum length of hash produced.
    type: integer

Outputs

_value:
  description: A YouTube-like hash.
  type: string