Questions tagged [guid]

A GUID (Globally Unique IDentifier) is a unique reference number used as an identifier in computer software.

A GUID (Globally Unique IDentifier) is a unique reference number used as an identifier in computer software. It is Microsoft's implementation of the UUID standard.

2008 questions
70
votes
8 answers

What are the performance improvement of Sequential Guid over standard Guid?

Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database? I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad…
massimogentilini
  • 4,102
  • 5
  • 29
  • 32
67
votes
13 answers

Why are there dashes in a .NET GUID?

Why are there dashes in a .NET GUID? Are there dashes in most implementations of a GUID, or is it just a Microsoft thing? Signed, 741ecf77-9c92-4435-8e6b-85975bd13452
Shawn
  • 19,465
  • 20
  • 98
  • 152
67
votes
7 answers

Check if Nullable Guid is empty in c#

Quoting from an answer from this question. Guid is a value type, so a variable of type Guid can't be null to start with. What then if I see this? public Nullable SomeProperty { get; set; } how should I check if this is null? Like…
Saturnix
  • 10,130
  • 17
  • 64
  • 120
65
votes
11 answers

Generate GUID in Windows with batch file

How can I generate a GUID in a batch file running using the commandline in Windows?
Pratik
  • 11,534
  • 22
  • 69
  • 99
64
votes
4 answers

How securely unguessable are GUIDs?

A while ago I worked on a web application where users could buy tickets. Due to the way our client's processes worked, what you effectively got as a result of your purchase was a URL with the ticket number in it. These were tickets to buy property…
teedyay
  • 23,293
  • 19
  • 66
  • 73
63
votes
3 answers

What does "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" means in WebSocket Protocol

I don't understand the meaning of "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" in RFC 6455. Why does the server need this magic string? And why does the WebSocket protocol need this mechanism?
Hakju Oh
  • 731
  • 1
  • 5
  • 5
62
votes
8 answers

How to generate a new GUID?

I'm working on a web service which requires a new GUID() passed as a reference to a method within the service. I am not familiar with C# or the GUID() object, but require something similar for PHP (so create a new object which from my understanding…
mauzilla
  • 3,574
  • 10
  • 50
  • 86
62
votes
7 answers

What's the C++ version of Guid.NewGuid()?

I need to create a GUID in an unmanaged windows C++ project. I'm used to C#, where I'd use Guid.NewGuid(). What's the (unmanaged windows) C++ version?
Simon
  • 25,468
  • 44
  • 152
  • 266
61
votes
3 answers

Performance - using Guid object or Guid string as Key

When using a Guid as an index for a Dictionary, is it better to use the Guid object, or the string representation of the Guid? I just refactored some code which was using string to use the object, because there were new Guid() calls all over the…
Benjol
  • 63,995
  • 54
  • 186
  • 268
60
votes
6 answers

Platform-independent GUID generation in C++?

What is the best way to programmatically generate a GUID or UUID in C++ without relying on a platform-specific tool? I am trying to make unique identifiers for objects in a simulation, but can't rely on Microsoft's implementation as the project is…
Moses Schwartz
  • 6,879
  • 3
  • 21
  • 11
59
votes
14 answers

How can I generate GUIDs in Excel?

I have an excel file with one order on each row, and I want each order to have a unique identifier, so there will be a Unique ID column. Every time I fill a row, I want Excel to automatically populate the Unique ID column for me. I did some research…
abw333
  • 5,571
  • 12
  • 41
  • 48
59
votes
7 answers

How should I store a GUID in Oracle?

I am coming from the SQL server world where we had uniqueidentifier. Is there an equivalent in oracle? This column will be frequently queried so performance is the key. I am generating the GUID in .Net and will be passing it to Oracle. For a couple…
Shaun Bowe
  • 9,840
  • 11
  • 50
  • 71
58
votes
6 answers

guid to base64, for URL

Question: is there a better way to do that? VB.Net Function GuidToBase64(ByVal guid As Guid) As String Return Convert.ToBase64String(guid.ToByteArray).Replace("/", "-").Replace("+", "_").Replace("=", "") End Function Function Base64ToGuid(ByVal…
Fredou
  • 19,848
  • 10
  • 58
  • 113
56
votes
1 answer

Why does Guid.ToByteArray() order the bytes the way it does?

When you call ToByteArray() on a GUID in .NET, the ordering of the bytes in the resulting array is not what you'd expect as compared to the string representation of the GUID. For example, for the following GUID represented as a…
Cory McCarty
  • 1,375
  • 4
  • 15
  • 23
56
votes
5 answers

How to generate unique 64 bits integers from Python?

I need to generate unique 64 bits integers from Python. I've checked out the UUID module. But the UUID it generates are 128 bits integers. So that wouldn't work. Do you know of any way to generate 64 bits unique integers within Python? Thanks.
Continuation
  • 12,722
  • 20
  • 82
  • 106