github.com/billybanfield/evergreen@v0.0.0-20170525200750-eeee692790f7/util/random.go (about)

     1  package util
     2  
     3  import (
     4  	"crypto/rand"
     5  	"encoding/hex"
     6  )
     7  
     8  // RandomString returns a cryptographically random string.
     9  func RandomString() string {
    10  	b := make([]byte, 16)
    11  	_, _ = rand.Read(b)
    12  	return hex.EncodeToString(b)
    13  }