wdef2 has asked for the wisdom of the Perl Monks concerning the following question:
He was originally trying to brute force it in bash :=) and running out of memory, so some lines of Perl using the Algorithm::Permute module was a definite improvement, leaving aside for the time being that anything like this probably ought to be done in C or Assembly anyway. (In any case, the main bottleneck is the time it takes to try each perm on openssl.)
However - Algorithm::Permute does not seem to be able to properly do perms _with replacement_ - to get more than one occurence of a char in a set you have to feed it the set twice etc and you get some redundant perms output. Also, less importantly, it does not appear to be thread safe since if I write a threads implementation it segfaults (though that could be my skill level at fault!).
Algorithm::Loop looks like it can handle perms with replacement and seems to be Praised and Glorified on high by some monks:
http://search.cpan.org/~tyemq/Algorithm-Loops-1.031/lib/Algorithm/Loops.pm#Introduction
I don't think I saw any reference to thread safety and I don't know if this one is XScode.
Is Algorthm::Loops the way to go?