.. index:: single: ids(Representation,Bytes)
.. _ids/2:

.. rst-class:: right

**object**

``ids(Representation,Bytes)``
=============================

* ``Representation`` - Text representation for the identifier. Possible values are ``atom``, ``chars``, and ``codes``.
* ``Bytes`` - Number of bytes of randomness.


Generator of random identifiers.

| **Availability:** 
|    ``logtalk_load(ids(loader))``

| **Author:** Paulo Moura
| **Version:** 1:1:0
| **Date:** 2026-02-26

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Uses:**
|    :ref:`base64 <base64/0>`
|    :ref:`fast_random <fast_random/0>`
|    :ref:`list <list/0>`
|    :ref:`os <os/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. index:: generate/1
.. _ids/2::generate/1:

``generate/1``
^^^^^^^^^^^^^^

Generate a random identifier.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``generate(Identifier)``
| **Mode and number of proofs:**
|    ``generate(--textids)`` - ``one``


------------

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

.. seealso::

   :ref:`ids <ids/0>`, :ref:`nanoid(Representation,Size,Alphabet) <nanoid/3>`, :ref:`cuid2(Representation,Size,Alphabet) <cuid2/3>`, :ref:`ksuid(Representation,Alphabet) <ksuid/2>`, :ref:`uuid(Representation) <uuid/1>`, :ref:`snowflakeid(Representation,EpochMilliseconds,TimeUnitMilliseconds,TimestampBits,NodeBits,SequenceBits,Node) <snowflakeid/7>`, :ref:`ulid(Representation) <ulid/1>`

