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
56
votes
10 answers

Sequential Guid Generator

Is there any way to get the functionality of the Sql Server 2005+ Sequential Guid generator without inserting records to read it back on round trip or invoking a native win dll call? I saw someone answer with a way of using rpcrt4.dll but I'm not…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
55
votes
8 answers

How Random is System.Guid.NewGuid()?

I know this may sounds like a pointless question, but hear me out... I basically want to know if I can trust the GUID to generate a value which will be unique 100% of the time and impossible to predict. I'm basically rolling my on login system for a…
GateKiller
  • 74,180
  • 73
  • 171
  • 204
53
votes
2 answers

Can we use Guid as a Primary Key in Sqlite Database

Is is possible to use GUID as primary Keys in SQLITE Database?If Possible which datatype can be used?
user2134137
  • 531
  • 1
  • 4
  • 6
52
votes
13 answers

What is a good unique PC identifier?

I've been looking at the code in this tutorial, and I found that it uses My.Computer.Name to save settings that shouldn't roam between computers. It's entirely possible, however, for a user to have two identically named PCs. If they wanted to have…
dlras2
  • 8,416
  • 7
  • 51
  • 90
52
votes
9 answers

How Random is System.Guid.NewGuid()? (Take two)

Before you start marking this as a duplicate, read me out. The other question has a (most likely) incorrect accepted answer. I do not know how .NET generates its GUIDs, probably only Microsoft does, but there's a high chance it simply calls…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
52
votes
9 answers

How does C# generate GUIDs?

How are GUIDs generated in C#?
Developer404
  • 5,716
  • 16
  • 64
  • 102
50
votes
3 answers

How are .NET 4 GUIDs generated?

I am aware of the multitude of questions here as well as Raymond's excellent (as usual) post. However, since the algorithm to create GUIDs was changed apparently, I found it hard to get my hands on any up-to-date information. The MSDN seems to try…
mafu
  • 31,798
  • 42
  • 154
  • 247
50
votes
4 answers

Guid == null should not be allowed by the compiler

The behaviour described below is specific to .net-3.5 only I just ran across the most astonishing behavior in the C# compiler; I have the following code: Guid g1 = Guid.Empty; bool b1= (g1 == null); Well, Guid is not nullable therefore it can…
Luis Filipe
  • 8,488
  • 7
  • 48
  • 76
50
votes
8 answers

Is there a GUID.TryParse() in .NET 3.5?

UPDATE Guid.TryParse is available in .NET 4.0 END UPDATE Obviously there is no public GUID.TryParse() in .NET CLR 2.0. So, I was looking into regular expressions [aka googling around to find one] and each time I found one there was a heated…
Jack Marchetti
  • 15,536
  • 14
  • 81
  • 117
50
votes
11 answers

Print a GUID variable

I have a GUID variable and I want to write inside a text file its value. GUID definition is: typedef struct _GUID { // size is 16 DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } GUID; But I want to write its…
Jeni
  • 587
  • 1
  • 5
  • 12
50
votes
2 answers

How do I obtain/use LibUUID?

I'm trying to replace a call to ::CoCreateGUID so I can generate GUIDs in a C++ program on Linux. I understand that libuuid supports this, and I've read this question. I'm a bit new to Ubuntu/GCC/Linux, so I've started off like this: #include…
waterlooalex
  • 13,642
  • 16
  • 78
  • 99
49
votes
6 answers

What are the chances to get a Guid.NewGuid () duplicate?

Possible Duplicate: Is a GUID unique 100% of the time? Simple proof that GUID is not unique In MSDN you can read: The chance that the value of the new Guid will be all zeros or equal to any other Guid is very low. Say that you have an method that…
Niklas
  • 1,753
  • 4
  • 16
  • 35
48
votes
5 answers

Aggregate Function on Uniqueidentifier (GUID)

Let's say I have the following table: category | guid ---------+----------------------- A | 5BC2... A | 6A1C... B | 92A2... Basically, I want to do the following SQL: SELECT category, MIN(guid) FROM myTable GROUP BY…
Heinzi
  • 167,459
  • 57
  • 363
  • 519
47
votes
8 answers

What is the most efficient way to encode an arbitrary GUID into readable ASCII (33-127)?

The standard string representation of GUID takes about 36 characters. Which is very nice, but also really wasteful. I am wondering, how to encode it in the shortest possible way using all the ASCII characters in the range 33-127. The naive…
mark
  • 59,016
  • 79
  • 296
  • 580
46
votes
4 answers

Convert from Oracle's RAW(16) to .NET's GUID

I'm having difficulties manually debugging an .NET application where the Guid values differ from .NET to Oracle. Where C# reads: 17D89D326C2142D69B989F5201288DBF Oracle reads: 329DD817216CD6429B989F5201288DBF How would I be able to manually…
rebelliard
  • 9,592
  • 6
  • 47
  • 80