Thread: Is this Perl
View Single Post
Old Oct 18th, 2007, 10:28 AM   #18
casesensitive
Newbie
 
Join Date: Oct 2007
Posts: 20
Rep Power: 0 casesensitive is on a distinguished road
Re: Is this Perl

Quote:
Originally Posted by iignotus View Post
ROFLMAO!!!! I'm actually rolling on this floor right here, laughing my ass off. What have you 'hacked' lately, then, there?
perl Syntax (Toggle Plain Text)
  1. use Digest::MD4 md4_hex;
  2.  
  3. my $goal = '8c91a67ef3a47031ec08830327848826'; # hash to find
  4. my @chars = ( a..z, 0..9 ); # characters to use
  5. my $minlen = 1; # minimum length of string
  6. my $maxlen = 8; # maximum length of string
  7.  
  8. for ( $minlen..$maxlen ) {
  9. print 'Length: ', $_, "\n";
  10. &checkStrings($_);
  11. }
  12.  
  13. sub checkStrings {
  14. my ( $n, $s ) = ( (shift) - 1, shift );
  15. for ( @chars ) {
  16. if ( $n ) {
  17. checkStrings($n, $s . $_ );
  18. } else {
  19. print $s, $_, "\n" if md4_hex( $s . $_ ) eq $goal;
  20. }
  21. }
  22. }
casesensitive is offline   Reply With Quote