# Generating random numbers that only come up once

## Recommended Posts

I am writing a bit of a brute force program that needs to find an eight digit number.

Instead of just counting from 00000000 to 999999999 I was wondering if it was possible to constantly generate numbers in between that range in a way that the numbers will only occur once... I don't want it to waste time trying the same number twice.

##### Share on other sites

Hmmm, thats a good question.

If you know how this is what i'd probably do.

Create an array to store the already tested values.

Do a for loops to check if the value you are trying has already been used.

If not continue brute forcing.

If so, generate another number.

although this way could waste a little bit of time... but the only way i can think of

~hope this helped you some..

##### Share on other sites

The thing you two are looking for is permutation + array I believe... Good luck with that. Might want to find another language to do your brute force with other than AutoIt for many reasons.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

Unless the chances of you accurately arriving at a number by choosing it at random are higher than doing it sequentially, why would you bother going to the extra effort?

Do you get feedback from whatever you are trying to crack (too high, too low, etc)? If so, use the binary split algorithm (try half way, if not valid split half of the half you had and keep doing this recursively until you get it). If not, just process it sequentially.

##### Share on other sites

get a random numb generator (aka one that generates more then 1 digit numb at a time... thats like 100 million different combos... good luck with that, my random numb generator would take like... a long time to generate... i have one that can do things like 6-letter words, with all characters in them... up to things with 100 trillion results, which would take many hours to generate.

What goes around comes around... Payback's a bitch.

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...