Guids, Unique Id's and Hashes

  • Thread starter Thread starter Chris Dunaway
  • Start date Start date
C

Chris Dunaway

I have used Guid's as a unique identifier in data applications. But in
a recent project, the length of the Guid's string is proving to be too
long. Is there a method for generating a unique string that is less
than the length of a Guid?

If I were to take the hash of a Guid string, what is the likelyhood
that two different Guids would have the same hash?

Can anyone offer any other suggestions?

Thanks
 
Chris Dunaway said:
I have used Guid's as a unique identifier in data applications. But in
a recent project, the length of the Guid's string is proving to be too
long. Is there a method for generating a unique string that is less
than the length of a Guid?

I am curious what the max. number of characters for the identifier in the
scenario you describe is...
 
At the moment, the length of the field is 30 characters, but the data
in it is in the following format (don't ask me why, I inherited this
code):

<custnum>-<uniqueid>-<city,state>

The entire string must be unique. The custnum, city, and state must
also be part of the string.

I can increase the size of the field, but I would then have to increase
the size of this same field in many other tables. I am hesitant to do
this unless I have to.

I was trying to determine a method to shorten the string.

Thanks
 
It's 8 bytes only - so I'm guessing if you aren't storing the GUID number,
but instead the actual decoded string, you will use up a tad more space ;)
 
Robin Tucker said:
It's 8 bytes only - so I'm guessing if you aren't storing the GUID number,
but instead the actual decoded string, you will use up a tad more space ;)

GUIDs are 16 bytes...
 
Yes, what I meant to say was that, a guid being 16 bytes (ehem, excuse my
math) might look like this:


ABACACABACACBACD (128 bits = 16 bytes = 16 ASCII chars)



but stored as a string it will be bigger, like this:

00000118-0000-0000-C000-000000000046 (36 characters)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top