Skip to content

Instantly share code, notes, and snippets.

@donovanhide
Created September 15, 2016 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donovanhide/7fc3ca5170e8080c9eddda4014394ce0 to your computer and use it in GitHub Desktop.
Save donovanhide/7fc3ca5170e8080c9eddda4014394ce0 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"math/big"
"github.com/btcsuite/btcutil/base58"
)
func main() {
encoded := "1HZwkjkeaoZfTSaJxDw6aKkxp45agDiEzN"
decoded, version, err := base58.CheckDecode(encoded)
if err != nil {
fmt.Println(err)
return
}
// Show the decoded data.
fmt.Printf("Decoded data: %x\n", decoded)
fmt.Printf("Decoded decimal: %s\n", big.NewInt(0).SetBytes(decoded))
fmt.Println("Version Byte:", version)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment