Security\Random::uuid

public uuid ()

Generates a v4 random UUID (Universally Unique IDentifier) The version 4 UUID is purely random (except the version). It doesn’t contain meaningful information such as MAC address, time, etc. See RFC 4122 for details of UUID. This algorithm sets the version number (4 bits) as well as two reserved bits. All other bits (the remaining 122 bits) are set using a random or pseudorandom data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any hexadecimal digit and y is one of 8, 9, A, or B (e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479).

$random = new \Phalcon\Security\Random();

  echo $random->uuid(); // 1378c906-64bb-4f81-a8d6-4ae1bfcdec22
doc_Phalcon
2016-10-16 09:56:31
Comments
Leave a Comment

Please login to continue.