In this article, we are going to learn how actually GUID is created.
Normally, we are using GUID commonly for uniqueness in the project, before start are we know about GUID? what is GUID? How to create GUID? If you know these answers, you ever wonder how actually its created and rare chance to duplicates?
So, first, let’s start with What is GUID?
GUID stands for Globally Unique Identifier or is also known as UUID which stand for Universally Unique Identifier. Normally Microsoft technology developers work with GUID and rest developer work with UUID. 16 bytes (128 bits) is acceptable for uniqueness.
How to create GUID?
You can create GUID by below line
var guid = Guid.NewGuid();
There are many methods for GUID, which you can use as per need.
The Main part is How GUID Is Generated?
If you noticed GUID that GUID is a combination of four-part. for example 70122D63-6FB3-E911-8369-ABBAE7037764,
Let’s break down GUID in four-part to understand.
Total Bits = 60 + 48 + 14 + 6 = 128 Bits
Or
Total Bytes = 7.5 + 6 + 1.75 + 0.75 = 16 Bytes
There are many GUID generation algorithms. All algorithms are designed in a way that not generates the same GUID twice, but here is another question come in mind that, Is GUIDs are 100% unique?. The answer is No, there is not guaranteed to be uniqueness. but there is a rare and very small chance or in the next fifty billion trillion years of being generated the same GUID twice. For example, just assume the sea, which has 7 * 1022 fishes, every fish could have 8.8×1015 universally unique GUIDs.
There are some key point which we should keep in mind,
Hope you guys found something useful, please give your valuable feedback/comments/questions about this article. Please let me know how you like and understand this article and how I could improve it.
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular