Skip to content

Commit 1e40069

Browse files
committed
Merge branch 'release/0.0.3'
2 parents 8e293a1 + 9cf91f8 commit 1e40069

File tree

6 files changed

+31
-18
lines changed

6 files changed

+31
-18
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Changelog
22

3+
## [0.0.3]
4+
5+
- Update core modules
6+
- Set default cores to all available minus 1
7+
8+
39
## [0.0.2]
410

511
- Show duration estimate for weeks, months and years
612

713

814
## [0.0.1]
915

10-
- First release
16+
- First release

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ VERSION ?= `[ -d ".git" ] && git describe --tags || echo "0.0.0"`
33
LDFLAGS=-ldflags "-s -w -X main.appVersion=${VERSION}"
44
BINARY="wireguard-vanity-keygen"
55

6-
build = echo "\n\nBuilding $(1)-$(2)" && GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/${BINARY}_${VERSION}_$(1)_$(2) \
6+
build = echo "\n\nBuilding $(1)-$(2)" && GO386=softfloat GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/${BINARY}_${VERSION}_$(1)_$(2) \
77
&& bzip2 dist/${BINARY}_${VERSION}_$(1)_$(2) \
88
&& if [ $(1) = "windows" ]; then mv dist/${BINARY}_${VERSION}_$(1)_$(2).bz2 dist/${BINARY}_${VERSION}_$(1)_$(2).exe.bz2; fi
99

@@ -21,7 +21,7 @@ release:
2121
$(call build,linux,386)
2222
$(call build,linux,arm)
2323
$(call build,linux,arm64)
24+
$(call build,darwin,arm64)
2425
$(call build,darwin,amd64)
25-
$(call build,darwin,386)
2626
$(call build,windows,386)
2727
$(call build,windows,amd64)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A command-line vanity (public) key generator for [WireGuard](https://www.wiregua
1212
- Optional case sensitive searching
1313
- Search multiple prefixes at once
1414
- Exit after results limit reached (defaults to 1)
15-
- Displays probablibilty and estimated runtime based on quick benchmark
15+
- Displays probability and estimated runtime based on quick benchmark
1616

1717

1818
## Usage options
@@ -22,7 +22,7 @@ Usage: wireguard-vanity-keygen [OPTIONS] <SEARCH> [<SEARCH>...]
2222
2323
Options:
2424
-c, --case-sensitive case sensitive match (default false)
25-
-t, --threads int threads (default 4)
25+
-t, --threads int threads (defaults to all available cores minus 1)
2626
-l, --limit int limit results to n (exists after) (default 1)
2727
```
2828

@@ -51,7 +51,7 @@ private 8IdcNsman/ZRGvqWzw1e5cRfhhdtAAmk02X9TkQxhHI= public pC1/N8coOcXmcwO09Q
5151
## Installing
5252

5353
Download the [latest binary release](https://github.com/axllent/wireguard-vanity-keygen/releases/latest) for your system,
54-
or build from source `go get -u github.com/axllent/wireguard-vanity-keygen`(go >= 1.11 required)
54+
or build from source `go install github.com/axllent/wireguard-vanity-keygen`.
5555

5656

5757
## FAQ
@@ -68,9 +68,9 @@ With case-insensitive searches (default), a-z have the chance of matching both u
6868

6969
### How accurate are the estimated times?
7070

71-
They are not and cannot be accurate. Keys are completely randomly generated, and the estimate is based on a law of averages. For instance, you could find a match for a one in a billion chance on the very first hit, or it could take you 5 billion attempts. It will however give you an indication based on word count, case sensitivity, and use of numbers or characters.
71+
They are not (and cannot be) accurate. Keys are completely randomly generated, and the estimate is based on a law of averages. For instance, you could find a match for a one in a billion chance on the very first hit, or it could take you 5 billion attempts. It will however give you an indication based on your CPU speed, word count, case sensitivity, and use of numbers or characters.
7272

7373

7474
### Why do I need this?
7575

76-
You don't. I wrote it because I run a WireGuard server, which does not provide any reference as to who the key belongs to (`wg` on the server). Using vanity keys, I can at least identify connections. I also wanted to learn more about multi-coe processing in Golang.
76+
You don't. I wrote it because I run a WireGuard server, which does not provide any reference as to who the key belongs to (`wg` on the server). Using vanity keys, I can at least identify connections. I also wanted to learn more about multi-core processing in Golang.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/axllent/wireguard-vanity-keygen
22

3-
go 1.14
3+
go 1.17
44

55
require (
66
github.com/spf13/pflag v1.0.5
7-
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71
7+
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
88
)

go.sum

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
22
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
3-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
4-
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71 h1:DOmugCavvUtnUD114C1Wh+UgTgQZ4pMLzXxi1pSt+/Y=
5-
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
6-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
7-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
8-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
3+
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce h1:Roh6XWxHFKrPgC/EQhVubSAGQ6Ozk6IdxHSzt1mR0EI=
4+
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
5+
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
6+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
8+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
10+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
11+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ func main() {
2222
var userCores int
2323

2424
flag := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
25-
cores := runtime.NumCPU()
25+
// detect number of cores minus one
26+
cores := runtime.NumCPU() - 1
27+
if cores == 0 {
28+
// if it is single-code then it
29+
cores = 1
30+
}
2631

2732
// set the default help
2833
flag.Usage = func() {

0 commit comments

Comments
 (0)