Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating different GUID for same lowercase and upper case strings

Tags:

c#

guid

.net-4.0

When I try to create GUIDs like this

Guid guid1 = Guid.Parse("aaaaaaaa-bbbb-cccc-eeee-ffffffffffff");
Guid guid2 = Guid.Parse("AAAAAAAA-BBBB-CCCC-EEEE-FFFFFFFFFFFF");

Both are creating same GUID object. Is it possible to create unique GUIDs for lower case and upper case version of same string?

Any ideas are welcome.

like image 371
Vibhore Tanwer Avatar asked Jun 11 '13 15:06

Vibhore Tanwer


People also ask

Is GUID comparison case sensitive?

Create New GUIDsGUID comparisons should be case sensitive, but there are some applications that use case insensitive comparison, and those applications can have problems with perfectly valid IFC models where GUIDs differ only by case.

Does case matter in GUID?

Are GUIDs case-sensitive? Yes, GUIDs are case-sensitive. The Paya Vault Service generates a 32 alpha-numeric GUID (token). The letters must be passed in the exact same format in which it was originally returned.

Can GUID be uppercase?

Since SQL Server stores guids as uppercase and C# treats them as lowercase, within C# code this is not an issue, so long as you don't treat them as strings. But, if you pull in the guids from SQL, which are always uppercased, and use those for Postman tests, they will fail.

Should GUIDs be upper or lower case?

The Guid itself is actually a 128-bit integer value and the string is a hexadecimal representation of the same value and hexadecimal is not case sensitive.


1 Answers

GUIDs are actually bytes parsed from hexadecimal.
That is not possible.

You should not use GUIDs to store arbitrary data.

like image 171
SLaks Avatar answered Oct 02 '22 11:10

SLaks