-
Notifications
You must be signed in to change notification settings - Fork 159
/
main.go
66 lines (50 loc) · 1.21 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import (
"fmt"
"log"
"os"
)
func main() {
coin := os.Args[1]
keysPerPage := 128
switch coin {
case "btc":
printBitcoinKeys(os.Args[2], keysPerPage)
case "btc-search":
printBtcWifSearch(os.Args[2], keysPerPage)
case "eth":
printEthereumKeys(os.Args[2], keysPerPage)
case "eth-search":
printEthPrivateKeySearch(os.Args[2], keysPerPage)
default:
log.Fatal("Invalid coin type")
}
}
func printBitcoinKeys(pageNumber string, keysPerPage int) {
bitcoinKeys := generateBitcoinKeys(pageNumber, keysPerPage)
length := len(bitcoinKeys)
for i, key := range bitcoinKeys {
fmt.Printf("%v", key)
if i != length-1 {
fmt.Print("\n")
}
}
}
func printBtcWifSearch(wif string, keysPerPage int) {
pageNumber := findBtcWifPage(wif, keysPerPage)
fmt.Printf("%v", pageNumber)
}
func printEthereumKeys(pageNumber string, keysPerPage int) {
ethereumKeys := generateEthereumKeys(pageNumber, keysPerPage)
length := len(ethereumKeys)
for i, key := range ethereumKeys {
fmt.Printf("%v", key)
if i != length-1 {
fmt.Print("\n")
}
}
}
func printEthPrivateKeySearch(privateKey string, keysPerPage int) {
pageNumber := findEthPrivateKeyPage(privateKey, keysPerPage)
fmt.Printf("%v", pageNumber)
}