Search code examples
iosuuid

Time-based UUID (version 1) on iOS?


How can we create a RFC 4122 complaint UUID (version 1, time-based) with iOS?


Solution

  • Here's the man page of the underlying library used by CFUUID and NSUUID. It contains the time based creation function:

    #include <uuid/uuid.h>
    
    uuid_generate_time(uuid_t);
    

    It's contained in iOS as well.