if you want, you can use "GetGUID" in Community Commons. This gives a numerical unique value. If you want to use text , you can add any letter characters.
I would suggest using the RandomHash action the the Community Commons module. This generates a random hash perfectly to use as a random unique identifier.