Where can I find a php lib for generating time-based (v1) UUID?
Thanks in advance!
Where can I find a php lib for generating time-based (v1) UUID?
Thanks in advance!
I assume you want something like this:
E.g.:
require_once('class.uuid.php');
$str = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, "abcdef");
echo $str;
// Output: 1b55e723-578b-4e34-d5cf-616263646566
For a native RFC compliant implementation, see http://jkingweb.ca/code/php/lib.uuid/
This implementation does not include code for acquiring MAC address to generated real v1 UUIDs (neither does any native PHP implementation I've seen).
If you can use PECL uuid package, go for it.