It is necessary to generate a number consisting of 16 digits, necessarily without a significant one. Just int here does not fit, but BigInteger is too big. The numbers must be unique, at least in the range of 200,000 copies.
long min = 1000000000000000; long max = 9999999999999999; Random rand = new Random(); long id = rand.Next((Int32)(min >> 32), (Int32)(max >> 32)); id = (id << 32); id = id | (long)rand.Next((Int32)min, (Int32)max); return id; in this case, and not always by 16 characters, and there are repetitions.
Hashsetand save all generated numbers there, when generating a new one - check. - Andrei NOP