La bibliothèque Uuid permet la création d'UUIDs v4 (aléatoires), v3 (MD5 hash) et v5 (SHA-1 hash).
libraries/Uuid.php
//Load library
$this->load->library('Uuid');
//Output a v4 UUID
echo $this->uuid->v4();
//Output a v3 UUID from a name and namespace (if a valid UUID namespace is omitted, a v4 generated UUID will be used)
echo $this->uuid->v3('My Name', '8d3dc6d8-3a0d-4c03-8a04-1155445658f7');
echo $this->uuid->v3('My Name');
//Output a v5 UUID from a name and namespace (if a valid UUID namespace is omitted, a v4 generated UUID will be used)
echo $this->uuid->v5('My Name', '8d3dc6d8-3a0d-4c03-8a04-1155445658f7');
echo $this->uuid->v5('My Name');
Pour plus d'informations sur UUID, consultez la page http://en.wikipedia.org/wiki/Universally_unique_identifier
Voir https://github.com/Repox/codeigniter-uuid
Ce document a été publié le 2018-12-09 07:46:34. (Dernière mise à jour : 2018-12-28 17:13:38.)