GUID: that is, Globally Unique Identifier (Globally Unique IDentifier) is also called UUID (Universally Unique Identifier ). GUID is a 128-bit digital identifier generated by a specific algorithm. it is used to indicate the uniqueness of a product. GUID is used to assign a unique identifier to a network or system with multiple nodes and computers. On Windows, GUID is widely used in Microsoft products and is used to identify objects such as registry items, classes and interfaces, databases, and system directories. The GUID format is "xxxxxxxx-xxxx-xxxxxxxxxxxx", where each x is a 32-bit hexadecimal number in the range of 0-9 or a-f. For example, 6F9619FF-8B86-D011-B42D-00C04FC964FF is a valid GUID value. ★GUID is unique in space and time to ensure that numbers are generated at different places at the same time. ★No two computers in the world will generate duplicate GUID values. ★When a GUID is required, it can be automatically generated by an algorithm and not managed by an authority. ★The GUID has a fixed length and is relatively short and small. it is suitable for sorting, identification, and storage.
- Function create_guid (){
- $ Charid = strtoupper (md5 (uniqid (mt_rand (), true )));
- $ Hyphen = chr (45 );//"-"
- $ Uuid = chr (123 )//"{"
- . Substr ($ charid, 0, 8). $ hyphen
- . Substr ($ charid, 8, 4). $ hyphen
- . Substr ($ charid, 12, 4). $ hyphen
- . Substr ($ charid, 16, 4). $ hyphen
- . Substr ($ charid, 20, 12)
- . Chr (1, 125 );//"}"
- Return $ uuid;
- }
|