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

Function newRandomStringN

pkg/cache/main_test.go:63–68  ·  view source on GitHub ↗

newRandomStringN creates a new random string of length n.

(n int)

Source from the content-addressed store, hash-verified

61
62// newRandomStringN creates a new random string of length n.
63func newRandomStringN(n int) string {
64 randBytes := make([]byte, n/2)
65 _, _ = rand.Read(randBytes)
66
67 return fmt.Sprintf("%x", randBytes)
68}

Callers 13

TestGetKeyFunction · 0.70
TestExistsFunction · 0.70
TestPutAndGetSizeFunction · 0.70
TestGetOrCreateFunction · 0.70
TestWriteAllTruncateFailFunction · 0.70
TestWriteAllFunction · 0.70
TestReadFromStartFunction · 0.70
TestFillInvalidFetchFunction · 0.70
TestFillFunction · 0.70
TestBytesFunction · 0.70
TestDropFunction · 0.70
setupFunction · 0.70

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected