Short simple iterative Java implementation of crunch
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
out/production/crunchy
src
.gitignore
LICENSE
README.md
crunchy.iml

README.md

Crunchy

A simplified, iterative Java implementation of the Linux crunch tool.

Standard crunch is well-written, however it's also:

  • implemented recursively
  • requires a particular alphabet input format
  • written entirely in an (arguably) hard-to-read single, sprawling, vanilla C sourcefile

While crunch is highly optimized, this iterative Java implementation competes against it quite admirably.

This Java version:

  • scales linearly w/respect to original crunch (+ JVM overhead, generally adds seconds)
  • neither prints any statistics nor has a 3 second delay prior to launch
  • does not currently implement most of the various options available w/standard crunch

My thoughts in writing this were that such a simple and fast implementation can be easily modified to suite your needs where crunch may have failed you. I hope somebody finds it useful.

Usage


# compile crunchy
javac Crunchy.java

# execute on default alphabet from 3 5 chars
java Crunchy 3 5 > crunchy.txt

See source for latest args. At this writing: Crunchy [minLen] maxLen [alphabet] [debugMode=false].

If you provide only maxLen, then minLen == maxLen.