I'm having trouble creating a random unsigned __int64 value, does anyone have a quick and efficient way to do something like this? below is what i am doing, check the code below.
unsigned __int64 m_RandomKey = 0; while(m_RandomKey == 0) { m_RandomKey = (unsigned __int64) rand() << 32 | rand(); }
What is the best way to create an unsigned __int64 key, so is it hard to get the same key again after a while or even at all? it should not be unique , as long as there is 1 in 18,446,744,073,709,551,615 chances that it will not do it again!
source share