tagged [guid]

Generate a UUID on iOS from Swift

Generate a UUID on iOS from Swift In my iOS Swift app I want to generate random UUID () strings for use as a table key, and this snippet to work: Is this safe? Or is there perhaps a better (recommende...

Guid.Parse() or new Guid() - What's the difference?

Guid.Parse() or new Guid() - What's the difference? What is the difference between these two ways of converting a string to `System.Guid`? Is there a reason to choose one over the other? or

5 Nov at 14:46

Is the format of GUID always the same?

Is the format of GUID always the same? GUID you get something like aaaef973-d8ce-4c92-95b4-3635bb2d42d5 Is it always the same? Is it always going to have the following format 8 char "-", 4 char "-", 4...

15 Oct at 02:49

How to make sure a generated guid is unique globally?

How to make sure a generated guid is unique globally? Let's say I want to set a guid to be my application's assembly guid. As searched from internet, we can use `(new Guid()).Next()` to get a new uniq...

5 Mar at 07:4

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

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. - - `17D89D326C2142D69B989F5201288DBF`- - ...

11 Jun at 05:47

long vs Guid for the Id (Entity), what are the pros and cons

long vs Guid for the Id (Entity), what are the pros and cons I am doing a web-application on asp.net mvc and I'm choosing between the long and Guid data type for my entities, but I don't know which on...

9 Feb at 11:23

Create a Guid from an int

Create a Guid from an int Given an `int`, how can you create the same Guid repeatedly? I'm integrating two systems, one uses ints as a primary key, the other recognises an object by it's Guid. Because...

21 Jul at 21:8

Should I Use Path.GetRandomFileName or use a Guid?

Should I Use Path.GetRandomFileName or use a Guid? I need to generate unique folder names, should I use [Path.GetRandomFileName](http://msdn.microsoft.com/en-us/library/system.io.path.getrandomfilenam...

3 Feb at 19:34

"Cannot implicitly convert type 'System.Guid?' to 'System.Guid'." - Nullable GUID

"Cannot implicitly convert type 'System.Guid?' to 'System.Guid'." - Nullable GUID In my database, in one of the table I have a GUID column with allow nulls. I have a method with a Guid? parameter that...

4 Mar at 15:3

What does the GUID in C# Programs in the AssemblyInfo.cs?

What does the GUID in C# Programs in the AssemblyInfo.cs? I'm wondering for what the GUID in the AssemblyInfo.cs in C# Programs is: `[assembly: Guid("a4df9f47-b2d9-49a9-b237-09220857c051")]` The comme...

19 Mar at 19:40

Simple proof that GUID is not unique

Simple proof that GUID is not unique I'd like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it's not working. How can I make it work?...

3 May at 05:49

Guid is all 0's (zeros)?

Guid is all 0's (zeros)? I'm testing out some WCF services that send objects with Guids back and forth. In my web app test code, I'm doing the following: For some reason, the call to is generating Gui...

2 Nov at 19:28

Is it good idea to remove dash from a GUID?

Is it good idea to remove dash from a GUID? I have code which replaces the dash with empty strings in a GUID. Would that remove the uniqueness of the guid? Also can someone confirm this too? We are st...

20 Oct at 17:20

Guid Uniqueness On different machine

Guid Uniqueness On different machine > [Is a GUID unique 100% of the time?](https://stackoverflow.com/questions/39771/is-a-guid-unique-100-of-the-time) After reading all posts on Guid, still I am un...

Check if Nullable Guid is empty in c#

Check if Nullable Guid is empty in c# Quoting from an answer from [this](https://stackoverflow.com/questions/9837602/why-isnt-there-a-guid-isnullorempty-method) question. > Guid is a value type, so a ...

25 Feb at 15:58

Questions about GUID's: Are they always fixed in length, and is the middle number always 4?

Questions about GUID's: Are they always fixed in length, and is the middle number always 4? I just generated a few million GUID's turned them into a String and got the length... it was always the same...

18 Sep at 04:27

Cannot convert string to GUID in C#.NET

Cannot convert string to GUID in C#.NET Why would the cast (to a System.Guid type) statement be invalid (second line in try block)? For example, suppose I have a string with a value of "5DD52908-34FF-...

10 Aug at 00:36

Performance - using Guid object or Guid string as Key

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 refact...

9 Dec at 17:58

Are automatically generated GUIDs for types in .NET consistent?

Are automatically generated GUIDs for types in .NET consistent? Are the automatically generated GUIDs for C# Types consistent? For example, if I get a GUID for my interface, IFoo (`typeof(IFoo).GUID`)...

13 Apr at 13:17

Why isn't Guid.ToString("n") the same as a hex string generated from a byte array of the same guid?

Why isn't Guid.ToString("n") the same as a hex string generated from a byte array of the same guid? Consider the following unit test: ``` [TestMethod] public void TestByteToString() { var guid...

24 Jun at 14:9

C# 4.0 Optional Parameters - How to Specify Optional Parameter of Type "Guid"?

C# 4.0 Optional Parameters - How to Specify Optional Parameter of Type "Guid"? Here's my method: `userId` is giving me an error as it must be a compile-time constant, which i understand. But even when...

How to generate UUID version 4 using c#

How to generate UUID version 4 using c# My requirement is to generate version 4 UUID from C# code for google API session token and i am not sure `Guid.NewGuid()` method, Which version of GUID does it ...

24 Apr at 06:12

Different casting of int to guid in C# and SQL Server

Different casting of int to guid in C# and SQL Server When converting int to guid in C# and SQL Server I get different values. In C# I use this method ``` public static Guid Int2Guid( int value ) { ...

Is it possible that GUIDs are generated with all the same characters in .NET? (e. g.: {11111111-1111-1111-1111-111111111111})

Is it possible that GUIDs are generated with all the same characters in .NET? (e. g.: {11111111-1111-1111-1111-111111111111}) We use GUIDs extensively in our database design; Business Object propertie...

28 Jan at 17:42

Get Window handle (IntPtr) from Selenium webdriver's current window GUID

Get Window handle (IntPtr) from Selenium webdriver's current window GUID I'm trying to capture a screenshot of whole browser screen (e.g. with any toolbars, panels and so on) not only an entire page, ...

20 Jul at 08:40