I'm trying to generate a random token that I can use while implementing reset password functionality. This (http://play.golang.org/p/mmAzXLIZML) is the dazzling and non-functional :( code that I came up with for a first try. It doesn't work as I'd hope because it produces the same token over and over again (which I assume is a function of the time not changing). How do I generate a random token with md5 that will change every time?
package main
import "fmt"
import "strconv"
import "time"
import "crypto/md5"
import "io"
func main() {
time := strconv.FormatInt(time.Now().Unix(), 10)
fmt.Println(time)
h := md5.New()
io.WriteString(h, time)
fmt.Printf("%x", h.Sum(nil))
}