@@ -84,13 +84,14 @@ v1.1.4; 2025-08-23
8484 added benchmark flag, -b (to benchmark current mode, disables output)
8585 compiled with Go v1.25.0 which gives a small performance boost to multiple algos
8686 added notes concerning some NTLM hashes not being crackable with certain hash cracking tools due to encoding gremlins
87- v1.1.5-dev; 2025-09-09.1600
88- added feature: "keep-order" from https://github.com/cyclone-github/hashgen/issues/7
87+ v1.1.5-dev; 2025-09-10.1000
8988 addressed raw base-16 issue https://github.com/cyclone-github/hashgen/issues/8
89+ added feature: "keep-order" from https://github.com/cyclone-github/hashgen/issues/7
90+ added dynamic lines/sec from https://github.com/cyclone-github/hashgen/issues/11
9091*/
9192
9293func versionFunc () {
93- fmt .Fprintln (os .Stderr , "Cyclone hash generator v1.1.5-dev; 2025-09-09.1600 \n https://github.com/cyclone-github/hashgen" )
94+ fmt .Fprintln (os .Stderr , "Cyclone hash generator v1.1.5-dev; 2025-09-10.1000 \n https://github.com/cyclone-github/hashgen" )
9495}
9596
9697// help function
@@ -701,12 +702,36 @@ func startProc(hashFunc string, inputFile string, outputPath string, hashPlainOu
701702
702703 // print stats
703704 elapsedTime := time .Since (startTime )
704- runTime := float64 (elapsedTime .Seconds ())
705- linesPerSecond := float64 (linesHashed ) / elapsedTime .Seconds () * 0.000001
705+ runTime := elapsedTime .Seconds ()
706+
707+ lps := float64 (linesHashed ) / runTime // raw lines/sec
708+
709+ unit := "" // < 1 K (oh, so slow)
710+ scaled := lps // lines per second
711+ switch {
712+ case lps >= 1e12 : // Trillion (not likely!)
713+ unit = "T"
714+ scaled = lps / 1e12
715+ case lps >= 1e9 : // Billion (what CPU is this?)
716+ unit = "B"
717+ scaled = lps / 1e9
718+ case lps >= 1e6 : // Million (yep)
719+ unit = "M"
720+ scaled = lps / 1e6
721+ case lps >= 1e3 : // Thousand (still so slow)
722+ unit = "K"
723+ scaled = lps / 1e3
724+ }
725+
706726 if hexDecodeErrors > 0 {
707727 log .Printf ("HEX decode errors: %d\n " , hexDecodeErrors )
708728 }
709- log .Printf ("Finished processing %d lines in %.3f sec (%.3f M lines/sec)\n " , linesHashed , runTime , linesPerSecond )
729+
730+ if unit == "" {
731+ log .Printf ("Finished processing %d lines in %.3f sec (%.3f lines/sec)\n " , linesHashed , runTime , scaled ) // < 1 K
732+ } else {
733+ log .Printf ("Finished processing %d lines in %.3f sec (%.3f %s lines/sec)\n " , linesHashed , runTime , scaled , unit ) // K +
734+ }
710735}
711736
712737// main func
0 commit comments