Created
April 13, 2018 13:09
-
-
Save kevsersrca/f31fbd2cfeda8bff04744988f6828eaf to your computer and use it in GitHub Desktop.
convert byte[size] to string
This file contains hidden or 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
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