Created
October 28, 2021 16:23
-
-
Save chappjc/8eb0423cdbb42fbadf8276b3bf756330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"os" | |
"decred.org/dcrdex/client/core" | |
) | |
func main() { | |
var appSeed string | |
flag.StringVar(&appSeed, "seed", "dcr", "Application Seed") | |
var assetID uint | |
flag.UintVar(&assetID, "asset", 0, "Asset ID") | |
flag.Parse() | |
appSeedB, err := hex.DecodeString(appSeed) | |
if err != nil { | |
fmt.Fprintf(os.Stderr, "bad app seed: %v\n", err) | |
os.Exit(1) | |
} | |
if len(appSeedB) != 64 { | |
fmt.Fprintf(os.Stderr, "app seed is %d bytes, expected 64\n", len(appSeedB)) | |
os.Exit(1) | |
} | |
seed, _ := core.AssetSeedAndPass(uint32(assetID), appSeedB) | |
fmt.Printf("%x\n", seed) | |
os.Exit(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment