MCPcopy Create free account
hub / github.com/TomDoesTech/GOTTH / generateRandomString

Function generateRandomString

internal/middleware/middleware.go:26–33  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

24}
25
26func generateRandomString(length int) string {
27 bytes := make([]byte, length)
28 _, err := rand.Read(bytes)
29 if err != nil {
30 return ""
31 }
32 return hex.EncodeToString(bytes)
33}
34
35func CSPMiddleware(next http.Handler) http.Handler {
36 // To use the same nonces in all responses, move the Nonces

Callers 1

CSPMiddlewareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected