mirror of
https://git.robbyzambito.me/robby/vawg.git
synced 2025-12-21 09:34:49 +00:00
Added wallet generator
This commit is contained in:
34
algo_wallet_gen.go
Normal file
34
algo_wallet_gen.go
Normal file
@@ -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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user