Dear ladies and sirs.
If two threads in a process generate a new GUID concurrently using .NET API (Guid.NewGuid()) is it possible that the two GUIDs will be identical?
Thanks.
UPDATE
I want to get practical. I know that it is widely assumed that GUIDs are unique for all practical purposes. I am wondering if I can treat GUIDS produced ...
Dear ladies and sirs.
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 implementation produces 22 characters, simply because 128 bits / 6 bits yiel...
OK, this may be a silly question but...
I have inherited a project and am tasked with going over the primary key relationships.
The project largely uses Guids. I say "largely" because there are examples where tables use integral types to reflect enumerations. For example, dbo.MessageFolder has MessageFolderId of type int to reflect
...
I am trying to edit an xslt file.
One line reads:
<xsl:if test="number(./@LatestAuthor) > 0">
The issue I have is that latest author used to be of type int and is now a nullable Guid. How can I edit the xslt file to check if @LatestAuthor is not null? Thanks.
...
Hello. I have an .NET (4.0) interface which is implemented with a ServicedComponent COM+ class:
interface DotNetIface
{
void MethodRef(var System.Guid guid);
void MethodArray(System.Guid[] guids, params object[] parameters);
void MethodCStyle([MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeConst=5)]S...
For a database I'm building, I've decided to use natural numbers as the primary key. I'm aware of the advantages that GUID's allow, but looking at the data, the bulk of row's data were GUID keys.
I want to generate XML records from the database data, and one problem with natural numbers is that I don't want to expose my database key's t...
I need to generate a GUID and save it via a string representation. The string representation should be as short as possible as it will be used as part of an already-long URL string.
Right now, instead of using the normal abcd-efgh-... representation, I use the raw bytes generated and base64-encode them instead, which results in a somewh...
In the day job, I work on a VB6 (I know, but don't mock the afflicted...) application that uses a number of libraries we have written (also in the ever illustrious VB6). One of these supporting libraries had a load of private members exposed via public properties, and I was asked to remove the properties, and promote the private member v...
We have a .NET app that needs to examine a folder that may contain COM libraries (DLL and OCX.) When we do encounter a COM library one thing we need to accomplish is to extract the GUID from the COM DLL or OCX.
Is there a straightforward way to do this with .NET without using 3rd party libraries?
...
Is it pronounced "Gewid" or is it prononced "G.U.I.D" by spelling out the letters. It seems inconsistently used. What is the proper pronountiaton? Same story goes for SQL. It seems more people say "S.Q.L." than "Sequel".
My co workers and I often argue about this. I want a definitive answer with something to preferrably back it up....
I know there is a minute possibility of a clash but if I generated a batch of 1000 GUIDs (for example), would it be safe to assume they're all unique to save testing each one?
Bonus question
An optimal way to test a GUID for uniqueness? Bloom filter maybe?
...
Possible Duplicate:
Generate UUID in Java
What are some of the best ways to create a GUID in Java?
...
What are the valid characters that can be used in a URL query variable?
I'm asking because I would like to create GUIDs of minimal string length by using the largest character set so long as they can be passed as a URL query variable (www.StackOverflow.com?query=guiddaf09834fasnv)
Edit
If you want to encode a UUID/GUID or any other in...
I just wrote this code to convert a GUID into a byte array. Can anyone shoot any holes in it or suggest something better?
public static byte[] getGuidAsByteArray(){
UUID uuid = UUID.randomUUID();
long longOne = uuid.getMostSignificantBits();
long longTwo = uuid.getLeastSignificantBits();
return new byte[] {
(byte)(longOne ...
How should a random number generator properly be implemented in REST?
GET RANDOM/
or..
POST RANDOM/
The server returns a different random number each time.
I can see arguments for both ways.
...
The official documentation says they are optional. I know COM interop requires a unique identifier for each interface but every interface example I see has a GUID whether it's used with COM or not? Is there any benefit to including a GUID if its not going to be used with COM?
...
Hi guys,
I am faced with the dilemma of changing my primary keys from int identities to Guid. I'll put my problem straight up. It's a typical Retail management app, with POS and back office functionality. Has about 100 tables. The database synchronizes with other databases and receives/ sends new data.
Most tables don't have frequent ...
As GUID generation is time-dependent, if System.Guid.NewGuid() is called multiple times at the exact same instant on different threads, could it return identical GUIDs?
...
I need to encrypt bytecode to send over a connection to a webservice, preferably using a GUID as a key. I have done a bit of research and found several classes developed for a similar purpose, but haven't been able to turn up much that is built into the Windows libraries.
My question is: Is there something built in to C# that performs t...
What is a good way to convert a file path (URI) into a System.Guid? I'd like to minimize the possibility of a collision, but I'm happy with a reasonably unique hashing (probably never more than a few dozen/hundred items in the database)
...