.. index:: single: nanoid(Representation,Size,Alphabet)
.. _nanoid/3:

.. rst-class:: right

**object**

``nanoid(Representation,Size,Alphabet)``
========================================

* ``Representation`` - Text representation for the NanoID. Possible values are ``atom``, ``chars``, and ``codes``.
* ``Size`` - Number of symbols in the NanoID.
* ``Alphabet`` - Alphabet used for generating NanoIDs represented as an atom, list of characters, or list of character codes.


NanoID generator.

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

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

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


| **Implements:**
|    ``public`` :ref:`nanoid_protocol <nanoid_protocol/0>`
| **Uses:**
|    :ref:`fast_random(Algorithm) <fast_random/1>`
|    :ref:`list <list/0>`
|    :ref:`os <os/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`nanoid_protocol/0::generate/1`  

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

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

(no local declarations; see entity ancestors if any)

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

(no local declarations; see entity ancestors if any)

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

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

.. seealso::

   :ref:`nanoid <nanoid/0>`, :ref:`ids(Representation,Bytes) <ids/2>`, :ref:`ulid(Representation) <ulid/1>`, :ref:`uuid(Representation) <uuid/1>`

