A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is also used.
When generated according to the standard methods, UUIDs are for practical purposes unique, without depending for their uniqueness on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicated is not zero, it is close enough to zero to be negligible.
Thus, anyone can create a UUID and use it to identify something with near certainty that the identifier does not duplicate one that has already been, or will be, created to identify something else. Information labeled with UUIDs by independent parties can therefore be later combined into a single database, or transmitted on the same channel, with a negligible probability of duplication.
Adoption of UUIDs and GUIDs is widespread, with many computing platforms providing support for generating them, and for parsing their textual representation.
Read more at Wikipédia
UUID Online.net is a very powerful and simple JavaScript UUID Generator.
A UUID (Universal Unique Identifier) is a 128-bit value used to uniquely identify an object or entity on the internet. Depending on the specific mechanisms used, a UUID is either guaranteed to be different or is, at least, extremely likely to be different from any other UUID generated until A.D. 3400.
UUIDs can be generated to refer to almost anything imaginable. For example, they can identify databases, system instances, primary keys, Bluetooth profiles or objects with short lifetimes.
UUID is a term analogous to GUID. Originally, GUID referred to a variant of UUID used by Microsoft, but the terms became synonymous in the RFC 4122 specification. UUID was standardized by the Open Software Foundation (OSF), becoming a part of the Distributed Computing Environment (DCE). Different versions of UUID follow the RFC 4122 specification.
UUIDs are generated using an algorithm based on a timestamp and other factors such as the network address.
The UUID relies on a combination of components to ensure uniqueness. UUIDs are constructed in a sequence of digits equal to 128 bits. The ID is in hexadecimal digits, meaning it uses the numbers 0 through 9 and letters A through F. The hexadecimal digits are grouped as 32 hexadecimal characters with four hyphens: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. The number of characters per hyphen is 8-4-4-4-12. The last section of four, or the N position, indicates the format and encoding in either one to three bits.
As an example, UUIDs based around time have segments that are divided by hyphens that signify low, mid and mid time and version as different timestamps used to identify the UID. The digits under the last section, the node, denote the MAC address.
There are three variants of UUID:
The current variant of UUID, variant 1, consists of five different versions. These versions differ in how they are constructed. Types of UUIDs include:
An extra version of UUID, and a special case, is the Nil UUID. This UUID contains all zeros for integers.
A collision is when the same UUID is generated more than one time and is assigned to different objects. Even though it is possible, the 128-bit value is extremely unlikely to be repeated by any other UUID. The possibility is close enough to zero, for all practical purposes, that it is negligible. Even in version 4 UUIDs, where there are fewer UUID combinations, the chance of a collision is low enough to be ignored.
Install uuid Package "npm install uuid"
import { v4 as uuidv4 } from 'uuid';
const myUuid = uuidv4();
console.log('Your UUID is: ' + myUuid);
Install the go.uuid Package "go get github.com/satori/go.uuid"
package main
import (
"fmt"
"github.com/satori/go.uuid"
)
func main() {
myuuid, err := uuid.NewV4()
fmt.Println("Your UUID is: %s", myuuid)
}
Simple function, requires PHP 7 or higher:
function guidv4($data = null) {
// Generate 16 bytes (128 bits) of random data or use the data passed into the function.
$data = $data ?? random_bytes(16);
assert(strlen($data) == 16);
// Set version to 0100
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
// Set bits 6-7 to 10
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
// Output the 36 character UUID.
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
$myuuid = guidv4();
echo $myuuid;
Install ramsey/uuid PHP Library "composer require ramsey/uuid"
use Ramsey/Uuid/Uuid;
$myuuid = Uuid::uuid4();
printf("Your UUID is: %s", $myuuid->toString());
The Python language has built-in support for generating Version 1, 3, 4 and 5 UUIDs. Check:
import uuid
myUuid = uuid.uuid4()
print('Your UUID is: ' + str(myUuid))
The C# language, via the .NET Framework, has built-in support for generating Version 4 UUIDs. Check:
using System;
using System.Diagnostics;
namespace SampleApplication {
class Program {
static void Main(string[] args) {
Guid myuuid = Guid.NewGuid();
string myuuidAsString = myuuid.ToString();
Debug.WriteLine("Your UUID is: " + myuuidAsString);
}
}
}
The VB.NET language, via the .NET Framework, has built-in support for generating Version 4 UUIDs. Check:
Imports System.Diagnostics
Module Module1
Sub Main()
Dim myuuid As Guid = Guid.NewGuid()
Dim myuuidAsString As String = myuuid.ToString()
Debug.WriteLine("Your UUID is: " & myuuidAsString)
End Sub
End Module
UUID Online.net is free and Maintained by BCJ IT Solutions . Created by Eduardo , Felipe , Fernando and Herbert .