Are you a developer working with microsoft technologies and looking for a unique identifiers for components/applications/files ? Or are you a database developer or administrator looking for primary keys tables?
Well! in this article I will show you how to create a GUID (globally unique identifier) which is the best version of an ID and almost as unique as a finger print.
GUIDs are 128-bit values commonly displayed as 32 hexadecimal digit and can be used on any item in the universe.
In this Article we shall use excel RANDBETWEEN and CHAR functions to generate this 32 hexadecimal digit.
►CHAR function generates characters based on their numeric code.(See Character Encoding)
For example smallcase for alphabets fall between code 99 (a) and 122(z)
►RANDBETWEEN functions generates a random number in a given range.
For example RANDBETWEEN(99,122) will be equal to either 99,100,101,102……..122 everytime it recalculates
Therefore CHAR(RANDBETWEEN(99,122)) will be equal to either a,b,c,d……..z everytime RANDBETWEEN recalculates.
A GUID follows a pattern of hexadecimal digits separated into five groups i.c 8-4-4-4-12 with this in mind you can be able to write a fomula as shown below
=CHAR(RANDBETWEEN(100,106))&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(133,333)&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(77,99)&"-"&RANDBETWEEN(0,5)&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(0,5)&CHAR(RANDBETWEEN(97,122))&"-"&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(723,971)&"-"&RANDBETWEEN(6,9)&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(6,9)&CHAR(RANDBETWEEN(97,122))&"-"&RANDBETWEEN(537,813)&CHAR(RANDBETWEEN(97,122))&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(493,503)&CHAR(RANDBETWEEN(97,122))&RANDBETWEEN(3,9)&CHAR(RANDBETWEEN(97,122))&CHAR(RANDBETWEEN(97,122))
The fomula results to a GUID like below
he139w86-2d4q-l970-7s6k-645xt500n6gm
Different developers use different types of GUIDs depending on the Item they want to identify thus the 3 types in our GUID Generator
- 81CI9K5423FYF2MZI19KWOT7YED6T468–UpperCased
- {vh148h972s0vt8496k9v727vw499u6rc}–Braced
- he139w86-2d4q-l970-7s6k-645xt500n6gm–Hyphened
That’s All!
Download GUID Generator and give it a Try
Those aren’t GUIDs, the letters and numbers need to be in hex range.