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

Bugfix, incorrect sorting for utf8 values below < 10 #36

Open 0xVavaldi opened 2 years ago

0xVavaldi commented 2 years ago

The issue is that it considers values < 10 to be incorrect in sorting order - so this 'hacky' trick is to make it think that it's actually in the right place. Using this method I was able to get a working example. The exception is when \r is involved - then rling removes data and sort keeps the \r

0xVavaldi commented 2 years ago

https://github.com/Cynosureprime/rling/issues/30 @hops was wondering if you could please take a look at this and see if my solution adequately resolves it.

Example use case

echo $'testing123\ntesting\x03\ntesting\x02\ntest\ntest\x02\n test\n  test\n' > file1
LC_ALL=C sort file1 > file1_sort
make && ./rling -s file1 file1_rling && hexdump -c file1_rling && hexdump -c file1_sort