util.uuid

Fairly often in XMPP you will want to generate pseudo-random, unique identifiers. The uuid library provides this functionality.

Usage

   local uuid = require "util.uuid";
 
   print("Your id is:", uuid.generate())

Reference

uuid.generate()

Returns an id, in the form of a string, in the UUIDv4 format, using a secure PRNG.

uuid.v4()

Added in development version

Alias of uuid.generate()

uuid.v7()

Added in development version

Returns an UUID composed of a high precision timestamp as well as random bytes. This means ids can be sorted by creation time, which may be desirable in databases.