How many of those numbers do you need? If you need an unlimited number of unique numbers, you may also need unlimited space to store such a number.
If you only want number in a specific range, say 0 to 2 billion, you could make sure you use each of these numbers exactly once, by storing the whole range and shuffle it. Then, each time you need a number, increment the index you last used to get the next number. When you reached the highest index, generate a new range, or just reuse the same range.
This solution will only cost you 8GB of data for 2 billion numbers, quaranteed to be unique amongs each other.
But, as you can imagine, there are often better solutions, and maybe you can live with a less unique number, a timestamp, or even just an incrementing counter.
If you're storing users in a database, you can make the database generate a unique userid for you. This will be an ever incrementing integer number. You won't hit the limit on userid's soon if you user an auto_increment int field.