MCPcopy Create free account
hub / github.com/Azure/peerd / newRandomStringN

Function newRandomStringN

pkg/files/store/main_test.go:50–55  ·  view source on GitHub ↗

newRandomStringN creates a new random string of length n.

(n int)

Source from the content-addressed store, hash-verified

48
49// newRandomStringN creates a new random string of length n.
50func newRandomStringN(n int) string {
51 randBytes := make([]byte, n/2)
52 _, _ = rand.Read(randBytes)
53
54 return fmt.Sprintf("%x", randBytes)
55}

Callers 1

setupFunction · 0.70

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected