Do the characters have to be in a particular order? You might check out the regex stuff.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Sep 10, 2001
That helped a little but I am still stuck. I am using ascii char but I am lookling at recursion to try and get done what I need to. Time was a factor, but I guess I got to sit down and pull out some computer science and algorithim skills in order to figure out a soultion.
I'd suggest forgetting about any kind of base 36, and build the strings yourself. Just loop through the ascii. One way that might be kind of cool would be to have however many nested for loops. In the very-most inner one, use the cascading loop variables to build your string. The innermost loop will run through all the way before the next one will, which will go all the way until the next one, etc., thus simulating an advancing number system. eh?
I've heard it takes forever to grow a woman from the ground
This code will run appromaxly 8000 years on my machine, which is about 2 years old and wasn't the fastest, when new. An actual machine might need about 2000 years. According to Moores Law, you could wait for about 10 years for a 4 Thz machine, which could solve it in 2 years. It would mean the same to wait 11 years and run the application in 1 year - results would be there in 12 years. Waiting longer wouldn�t make much sense But I would check in 2010, whether Moores Law is still valid
On the other hand: If you have a cluster of 36x36 machines of 4 Ghz, it could be solved in about 2 years.
[ August 01, 2004: Message edited by: Stefan Wagner ] [ August 01, 2004: Message edited by: Stefan Wagner ]
That calculation is probably pessimistic, meaning that you have to run through every single combination before finding the right one. On average you'd probably have to go through 1/2 of the combinations before hitting it - so maybe 4000 years?
Michael: MAX_RADIX is set to 36, so my solution can't be modified to handle distinguishing of Upper and Lowercase.
While "case does not matter" sounds like "don't distinguish them", the second part of the sentence "it can be upper or lower" sounds like the opposite.
Now Anthony - does it matter or not? do we have 36 different characters, or 62? Ah - the post before he said:
I want to go from 0-Z 0,1,2...9,A,B....Y,Z
But Michael, I guess every character may occur multiple times - this would especially be my expection for a password. And though your solution produces less results when truncated to 36 values, (36*35*34* ... *24) - compared to mine (36^12) - it's slower.
But of course - premature optimization is the root of all evil - so forget about my optimized one, and refactor yours! [ August 01, 2004: Message edited by: Stefan Wagner ]
Joined: Sep 10, 2001
Joined: Jun 09, 2003
I guess every character may occur multiple times - this would especially be my expection for a password.