> Hi,
>
> I was just curious how you would go about creating a unique identifier
> with 3 ints.
What is the range of the three inputs? 32-bit signed?
What is the data type needed for the output? String? Numeric? Size
constraints?
why not just use the Guid object?

Signature
-iwdu15
DaTurk,
I would treat the three integers as components of a larger, 96 bit
integer. Because there isn't an algorithm for generating higly-unique
96-bit integers (unlike GUIDs, which are 128 bits), I would suggest starting
at 0, and then incrementing by 1 every time you need a new value (across the
96 bits, which you will have to code yourself).

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi,
>
> I was just curious how you would go about creating a unique identifier
> with 3 ints.
Nicholas Paldino [.NET/C# MVP] - 24 Jul 2007 18:57 GMT
For clarification, by 96-bit integer, I mean 96-bit unsigned integer.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> DaTurk,
>
[quoted text clipped - 8 lines]
>> I was just curious how you would go about creating a unique identifier
>> with 3 ints.
Ben Voigt [C++ MVP] - 24 Jul 2007 19:00 GMT
> DaTurk,
>
[quoted text clipped - 3 lines]
> starting at 0, and then incrementing by 1 every time you need a new value
> (across the 96 bits, which you will have to code yourself).
Too bad C# doesn't support the obfusc... I mean succinct syntax for handling
carry when incrementing a compound integer:
++num1 || ++num2 || ++num3; // num3 is most significant
> Hi,
>
> I was just curious how you would go about creating a unique identifier
> with 3 ints.
Your question seems a little vague. What are the 3 ints? Just *any*
3 ints? Perhaps a little more about what you are trying to accomplish
will suggest some viable alternatives.
Chris
The reason this seems vague is that you don't state whether you need to get
back to the three ints from the unique identifier. If this is the case,
there are several options. If it is not a requirement, then just return an
incrimented static counter.
> Hi,
>
> I was just curious how you would go about creating a unique identifier
> with 3 ints.
DaTurk - 30 Jul 2007 17:18 GMT
On Jul 24, 10:06 pm, ModelBuilder
<ModelBuil...@discussions.microsoft.com> wrote:
> The reason this seems vague is that you don't state whether you need to get
> back to the three ints from the unique identifier. If this is the case,
[quoted text clipped - 7 lines]
>
> - Show quoted text -
My apologies. I have three signed integers. 32 bit, c# integers.
They are part of a structure that I'm going to be storing, but it
takes looking at all three of them together to make sure that the
structures are not duplicated. SO I was thinking I could just "or"
them together, or something of the like to create one unique
identifer.
I was thinking you could make all three strings, then append them, end
to end, and then convert them back to an int. But, it could get
bigger then a 64 bit long, which is as big as I want to go.