diff options
author | Robby Zambito <contact@robbyzambito.me> | 2021-02-28 21:07:20 +0000 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2021-02-28 21:07:20 +0000 |
commit | 03b6a333a3c7ed8f8334726f6bede2e200096150 (patch) | |
tree | 217e325120315f1465e01547ead4dba92a448890 | |
parent | 2d053f79e6434f364b194f6123f6c22c6de35fff (diff) |
Added wallet generator
-rw-r--r-- | algo_wallet_gen.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/algo_wallet_gen.go b/algo_wallet_gen.go new file mode 100644 index 0000000..631b9d9 --- /dev/null +++ b/algo_wallet_gen.go @@ -0,0 +1,34 @@ +package main + +import ( + "fmt" + "github.com/algorand/go-algorand-sdk/crypto" + "github.com/algorand/go-algorand-sdk/mnemonic" + "os" + "regexp" + "runtime" +) + +func main() { + walletChan := make(chan string) + pattern := os.Args[1] + for i := 0; i < runtime.NumCPU(); i++ { + go func() { + for { + account := crypto.GenerateAccount() + go func(acc crypto.Account) { + m, _ := mnemonic.FromPrivateKey(acc.PrivateKey) + wallet := fmt.Sprintf("%s:%s\n", acc.Address, m) + matched, _ := regexp.MatchString(pattern, wallet) + if matched { + walletChan <- wallet + } + }(account) + } + }() + } + + fmt.Println(<-walletChan) + os.Exit(0) + +} |