• A function to generate a unique id and return it in the context of a template, if supplied.

    A template is a string that can contain ${%s} to be replaced with a unique id. If the template contains the "%s" placeholder, it will be replaced with the unique id otherwise the id will be appended to the template.

    Parameters

    • Optional options: {
          length?: number;
          template?: string;
      }

      an object with the following properties:

      • template: a template string.
      • length: the length of the unique id as presented in hexadecimal.
      • Optional length?: number
      • Optional template?: string

    Returns string