You can use
this[
^] to create unique random numbers. It is a C# code but does what you need. Hope you can understand it.
Creating truly random numbers is a very tough job. If you need truly random numbers, search for any already existing library. I am not aware of one but google should be.