Skip to content

Commit 5d61a1d

Browse files
added dynamic lines/sec #11
added dynamic lines/sec #11
2 parents 6211ff4 + 323b2dc commit 5d61a1d

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
### v1.1.5-dev; 2025-09-09.1600
1+
### v1.1.5-dev; 2025-09-10.1000
22
```
3-
added feature: "keep-order" from https://github.com/cyclone-github/hashgen/issues/7
43
addressed raw base-16 issue https://github.com/cyclone-github/hashgen/issues/8
4+
added feature: "keep-order" from https://github.com/cyclone-github/hashgen/issues/7
5+
added dynamic lines/sec from https://github.com/cyclone-github/hashgen/issues/9
56
```
67
### v1.1.4; 2025-08-23
78
```

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ Hashgen is a CLI hash generator written in Go and can be cross compiled for Linu
2424
To use hashgen, type your mode, wordlist input & hash output files with a simple command line.
2525

2626
### Features:
27+
- Maintains original input order [PR 10](https://github.com/cyclone-github/hashgen/pull/10)
2728
- Supports 38+ modes/functions (see list below)
2829
- Encode / decode base64 & base58
2930
- Hex / dehex wordlists
30-
- Supports ASCII, UTF-8 and $HEX[] wordlist input
31+
- Supports ASCII, UTF-8 and $HEX[] input
32+
- Supports UTF-8 (default) or $HEX[] output
3133

3234
| Useage Examples | Command Line |
3335
|-----------|-----------|

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/cyclone-github/base58 v1.0.1
77
github.com/ebfe/keccak v0.0.0-20150115210727-5cc570678d1b
88
github.com/openwall/yescrypt-go v1.0.0
9-
golang.org/x/crypto v0.41.0
9+
golang.org/x/crypto v0.42.0
1010
)
1111

12-
require golang.org/x/sys v0.35.0 // indirect
12+
require golang.org/x/sys v0.36.0 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ github.com/ebfe/keccak v0.0.0-20150115210727-5cc570678d1b h1:BMyjwV6Fal/Ffphi4dJ
44
github.com/ebfe/keccak v0.0.0-20150115210727-5cc570678d1b/go.mod h1:fnviDXB7GJWiSUI9thIXmk9QKM8Rhj1JV/LcMRzkiVA=
55
github.com/openwall/yescrypt-go v1.0.0 h1:jsGk48zkFvtUjGVOhYPGh+CS595JmTRcKnpggK2AON4=
66
github.com/openwall/yescrypt-go v1.0.0/go.mod h1:e6CWtFizUEOUttaOjeVMiv1lJaJie3mfOtLJ9CCD6sA=
7-
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
8-
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
9-
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
10-
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
7+
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
8+
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
9+
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
10+
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=

hashgen.go

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

9293
func versionFunc() {
93-
fmt.Fprintln(os.Stderr, "Cyclone hash generator v1.1.5-dev; 2025-09-09.1600\nhttps://github.com/cyclone-github/hashgen")
94+
fmt.Fprintln(os.Stderr, "Cyclone hash generator v1.1.5-dev; 2025-09-10.1000\nhttps://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

Comments
 (0)