I was hoping someone with better math capabilities would assist me in figuring out the total possibilities for a string given it’s length and character set.
i.e. [a-f0-9]{6}
What are the possibilities for this pattern of random characters?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is equal to the number of characters in the set raised to 6th power.
In Python (3.x) interpreter:
EDIT 1:
Why 16.7 million? Well, 000000 … 999999 = 10^6 = 1M, 16/10 = 1.6 and
* EDIT 2:*
To create a list in Python, do:
print(['{0:06x}'.format(i) for i in range(16**6)])However, this is too huge. Here is a simpler, shorter example:
EDIT 3:
As a function:
This will take a while to print at numDigits = 6.
I recommend dumping this to file instead like so: