Algorithm for unique CD-KEY generation with validation

后端 未结 5 683
忘掉有多难
忘掉有多难 2021-01-01 02:46

I am trying to create a unique CD-KEY to put in our product\'s box, just like a normal CD-KEY found in standard software boxes that users use to register the product.

<
5条回答
  •  灰色年华
    2021-01-01 03:45

    Generate GUID and catenate a random number to it. GUID is guaranteed to be unique and random number will make it improbable to hit a code accidentally. Just don't modify the GUID in any way or you might compromise the uniqueness.

    http://msdn.microsoft.com/en-us/library/aa475087.aspx

提交回复
热议问题