I am hashing passwords using Sha256.Sum256 then I'm supposed to store the hashed password on the database, but what I get instead is a byte array instead of a hex value. I cannot do ("%x", hash) because that only works on fmt
"I cannot do ("%x", hash) because that only works on fmt" I don't understand this. This works, and returns the hexa string representation: fmt.Sprintf("%x", sha256.Sum256([]byte{1, 2}))
fmt.Sprintf("%x", sha256.Sum256([]byte{1, 2}))hex.EncodeToString(hash[:]), see Why can not convert [Size]byte to string in Go?