title: Create Random Number Sequence with No Repeats
body: <h3>Duplicate:</h3>
  <blockquote>
  <p><a href="https://stackoverflow.com/questions/196017/unique-random-numbers-in-o1">Unique random numbers in O(1)?</a></p>
  </blockquote>
  <p>I want an pseudo random number generator that can generate numbers with no repeats in a random order.</p>
  <p>For example:</p>
  <p>random(10)</p>
  <p>might return
  5, 9, 1, 4, 2, 8, 3, 7, 6, 10</p>
  <p>Is there a better way to do it other than making the range of numbers and shuffling them about, or checking the generated list for repeats?</p>
  <hr />
  <h3>Edit:</h3>
  <p>Also I want it to be efficient in generating big numbers without the entire range.</p>
  <hr />
  <h3>Edit:</h3>
  <p>I see everyone suggesting shuffle algorithms. But if I want to generate large random number (1024 byte+) then that method would take alot more memory than if I just used a regular RNG and inserted into a Set until it was a specified length, right? Is there no better mathematical algorithm for this.</p>