Skip to content

Instantly share code, notes, and snippets.

@jbenet
Created February 1, 2015 09:29
Show Gist options
  • Save jbenet/b9d92248887edafa570d to your computer and use it in GitHub Desktop.
Save jbenet/b9d92248887edafa570d to your computer and use it in GitHub Desktop.
func getProgramVersion() string {
f, _ := os.Open(os.Args[0])
h := sha2.New()
io.Copy(h, f)
sum := h.Sum(nil)
mh, _ := mh.Encode(sum, mh.SHA2_256)
return mh.B58String()
}
@jbenet
Copy link
Author

jbenet commented Feb 1, 2015

i need to make https://github.com/jbenet/go-multihash do reader sums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment