MCPcopy
hub / github.com/coder/websocket / Bytes

Function Bytes

internal/test/xrand/xrand.go:12–19  ·  view source on GitHub ↗

Bytes generates random bytes with length n.

(n int)

Source from the content-addressed store, hash-verified

10
11// Bytes generates random bytes with length n.
12func Bytes(n int) []byte {
13 b := make([]byte, n)
14 _, err := rand.Reader.Read(b)
15 if err != nil {
16 panic(fmt.Sprintf("failed to generate rand bytes: %v", err))
17 }
18 return b
19}
20
21// String generates a random string with length n.
22func String(n int) string {

Callers 4

TestConnFunction · 0.92
randMessageFunction · 0.92
StringFunction · 0.85
Base64Function · 0.85

Calls 1

ReadMethod · 0.45

Tested by 1

TestConnFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…