In Linux, the uuidgen [-r] [-t] command is used to generate UUID. You can generate a 32-bit string, which is obtained through the command line. There is a uu in usrincludelib.
In Linux, there are commands dedicated to UUID generation:
Uuidgen [-r] [-t].
You can generate a 32-bit string, which is obtained through the command line. There is a/uuid. h in/usr/include/lib, which defines the data uuid and the unsigned character pointer. Uuid_generate (uuid_t uu) is a function dedicated to UUID generation. The UUID generated is placed in the parameter UU. The result is an 8-digit hexadecimal number.
During the UUID generation function, after some processing, the 8-bit hexadecimal number is generated. The reason is that during the generation process, originally, a 32-bit long integer is generated. The result is converted to an 8-bit hexadecimal number through uid_parse. Instead, we have the uuid_unparse function, which can reverse convert the hexadecimal number to a 32-bit integer.
Note: When compiling uuid functions in linux, we need to connect the database, that is, add a-luuid. Full form:
Gcc-o uuid. c-luuid
At the same time, when defining the 32-bit long integer string for saving the transformation, we need to reasonably allocate space. the safest way is to apply for a pointer to store one character for passing, avoid doing this!