Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Created April 13, 2018 13:09
Show Gist options
  • Save kevsersrca/f31fbd2cfeda8bff04744988f6828eaf to your computer and use it in GitHub Desktop.
Save kevsersrca/f31fbd2cfeda8bff04744988f6828eaf to your computer and use it in GitHub Desktop.
convert byte[size] to string
data := []byte("testing")
b := md5.Sum(data)
//this is mostly invalid characters
fmt.Println(string(b[:]))
pass := hex.EncodeToString(b[:])
fmt.Println(pass)
// or
pass = fmt.Sprintf("%x", b)
fmt.Println(pass)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment