Cynosureprime / rling

RLI Next Gen (Rling), a faster multi-threaded, feature rich alternative to rli found in hashcat utilities.
MIT License
81 stars 11 forks source link

Incorrect --help text #28

Closed PenguinKeeper7 closed 3 years ago

PenguinKeeper7 commented 3 years ago

The --help text for the -M arg is: -M memsize Maximum memory to use for -f mode When it only applies in -2, instead of -f.

> ./rling -2 -M 4294965097 file1 file2
Memory for cache set to 4294965097 bytes (was 52428800)
Estimated memory required: 4,294,965,320 (4.00Gbytes)

> ./rling -f -M 4294965097 "Collection 4\Combined3.txt" "Collection 4\Combined4.txt"
Memory for cache set to 4294965097 bytes (was 52428800)
   - but this will have no effect, unless -2 is in use
Estimated memory required: 104,857,632 (100.00Mbytes)

(Tested on both Windows and Linux)

roycewilliams commented 3 years ago

Thanks for the report. Can you be more explicit about what's incorrect? Oh, my bad - I see what you're saying. Man, I'm reading too fast ... too often in the past week. :D

Waffle2 commented 3 years ago

Several things....

-M "knows" about suffixes, so you can say things like -M 4g for 4 gigabytes of memory, or 512k, 32m, etc.

It was originally used for other purposes, but ended up being used only for -2 (dealing only with pre-sorted files). The -2 mode is very useful if you have a lot of already-sorted lists. The -M allocated memory is split between the number of files being processed, which can result in problems if you have a large number of files with very long lines in them, thus the ability to set the cache size larger if this is a problem. The default of 50mbytes is adequate (about 500 msec of "buffer" memory at 100M/sec), and if it finds lines that are too long for the current value, it will prompt you to increase it.

Updating the help to specify that it only works on -2, not -f, is the right choice. I've made that change here, and will push it on the next update.