github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/inspector/internal/utils.go (about) 1 package internal 2 3 import ( 4 "crypto/rand" 5 ) 6 7 // Nonce returns random string that is used to store unique items in herocache. 8 func Nonce() ([]byte, error) { 9 b := make([]byte, 16) 10 _, err := rand.Read(b) 11 if err != nil { 12 return nil, err 13 } 14 return b, nil 15 }