UUID

Universally Unique Identifier or GUID Globally Unique Identifier which in practice it’s the same thing.

It’s composed by 128 Bits represented by 32 digits Hexadecimal, divided by 5 groups separeted by “-” with struct: 8-4-4-4-12.

The goal identify un…


This content originally appeared on DEV Community and was authored by Allison Piovani

Universally Unique Identifier or GUID Globally Unique Identifier which in practice it's the same thing.

It's composed by 128 Bits represented by 32 digits Hexadecimal, divided by 5 groups separeted by "-" with struct: 8-4-4-4-12.

The goal identify unique information in the System, whithout a central chord.

Exist 5 versions, the first digit from third batch, is separated to identify the version of UUID.

Versions

v1
Uses timestemp to generate the UUID, also can use NodeID which is an identifier, usually for that MAC of the computer, or URL or prefixed data key.

v2
Very similiar to v1, but the use of NodeID is mandatory to present a security group, this group may be related to entities or some context of the application. But veru little used.

v3 and v5
It also use NodeIDas prefix. In v3 is used an MD5 hash key, while in v5 a has key of the SHA-1 algorithm is used, this second being more advised for development.

v4
It is the most used version, in this case all characters are randomly generated.

Benefits

  • It's also a form of information security, the ID format increment informs how many users there may be on the plaform, important information for competitiros;

  • Greater security if you don't have Authorization control in the application.

Disadvantages

  • Makes debugging records more complex;

  • Increase in the cost of storage, storing in string format, char(32) can make the performance of queries quite heavy, a solution is to store in binaries;

  • Must have a position rule, since the collision is possible.

Go

Inside Go we have a lot of packages that press UUID, but in this demo we will use the official google package Package, in addition to supporting all of the above versions. The project link is here: Project


This content originally appeared on DEV Community and was authored by Allison Piovani


Print Share Comment Cite Upload Translate Updates
APA

Allison Piovani | Sciencx (2022-07-17T02:21:44+00:00) UUID. Retrieved from https://www.scien.cx/2022/07/17/uuid/

MLA
" » UUID." Allison Piovani | Sciencx - Sunday July 17, 2022, https://www.scien.cx/2022/07/17/uuid/
HARVARD
Allison Piovani | Sciencx Sunday July 17, 2022 » UUID., viewed ,<https://www.scien.cx/2022/07/17/uuid/>
VANCOUVER
Allison Piovani | Sciencx - » UUID. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/17/uuid/
CHICAGO
" » UUID." Allison Piovani | Sciencx - Accessed . https://www.scien.cx/2022/07/17/uuid/
IEEE
" » UUID." Allison Piovani | Sciencx [Online]. Available: https://www.scien.cx/2022/07/17/uuid/. [Accessed: ]
rf:citation
» UUID | Allison Piovani | Sciencx | https://www.scien.cx/2022/07/17/uuid/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.