Skip to content

Short simple iterative Java implementation of crunch

License

Notifications You must be signed in to change notification settings

entangledloops/crunchy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Short simple iterative Java implementation of crunch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages