title: How to generate 64 bit random numbers?
body: <p>I'm implementing universal hashing and using the following universal hash function :</p>
  
  <blockquote>
    <p>h(k)=((A*k)mod 2^64) rsh 64-r</p>
  </blockquote>
  
  <p>where A is a random number between </p>
  
  <blockquote>
    <p>2^61 and 2^62.</p>
  </blockquote>
  
  <p>The <code>rand()</code> function in <em>C++</em> has return type <em>integer</em> and it can't generate that big numbers. So how can i generate random numbers in this range? (numbers should be very random i.e. every number should have equal probability to be selected)</p>
  
  <p>Note: </p>
  
  <pre><code>long long int random=rand();
  </code></pre>
  
  <p>doesn't work as the number returned by <code>rand</code> is <em>int</em>.</p>