mirror of
https://git.robbyzambito.me/robby/vawg.git
synced 2025-12-20 12:34:50 +00:00
35 lines
648 B
Go
35 lines
648 B
Go
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)
|
|
|
|
}
|