util.uuid API

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.

Note: In Prosody 0.4 and earlier, there was no guarantee that a generated id will actually be unique. In 0.5 and later a string in the UUIDv4 format is returned, however with a dubious PRNG. As of Prosody 0.9.9, /dev/urandom is used as PRNG.

 
doc/developers/util/uuid.txt · Last modified: 2017/03/01 20:25 by Kim Alvefur