Insomnia 24/7 character generator

Have a tool that you think is awesome enough to be promoted by Hackerthreads? Submit it in a thread here. This forum is write-only, like a drop-box, and you will not be able to see other threads.
Post Reply
User avatar
Not a sandwich
Posts: 1881
Joined: Fri May 09, 2003 1:20 pm
Location: 41 6d 73 74 65 72 64 61 6d

Insomnia 24/7 character generator

Post by Cool_Fire » Mon Mar 28, 2011 6:49 am

Name of Tool: Gen
Author: Cool Fire
Language coded in: Perl
What it does: Generates all possible combinations of a set of characters for a specified length
Other notes: Probably not too useful on it's own, but handy to have around for custom brute force scripts and such.

Code: Select all

# Will generate all combinations of the given characters for a given length
sub gen;
@chars = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); # This should hold all the characters you want in the mix.
$length = 6; # Set the length you want here.
my @word = ((0) x $length - 1); # Create null array of the length we need
&gen(0); # Start generating at the first character.
sub gen {
	foreach $char (@chars) {
		@word[$_[0]] = $char;
		if($_[0] < $length - 1) {
			&gen($_[0] + 1);
		} else {
			print @word; print "\n";
Source with syntax highlighting
If we're breaking the rules, then how come you can't catch us? You can't find us? I know why. Cause, it's ... MAGIC!
Hackerthreads chat, where the party is going 24/7.

Post Reply