A bit late, but keep in mind that using string(b[:]) will print mostly invalid characters.
If you are trying to get a hexadecimal representation like php you can use something like:
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)
playground
source share