MCPcopy
hub / github.com/syncthing/syncthing / ReadRand

Function ReadRand

test/util.go:251–260  ·  view source on GitHub ↗
(bs []byte)

Source from the content-addressed store, hash-verified

249}
250
251func ReadRand(bs []byte) (int, error) {
252 var r uint32
253 for i := range bs {
254 if i%4 == 0 {
255 r = uint32(rand.Int63())
256 }
257 bs[i] = byte(r >> uint((i%4)*8))
258 }
259 return len(bs), nil
260}
261
262func randomName() string {
263 var b [16]byte

Callers 2

TestManyPeersFunction · 0.85
randomNameFunction · 0.85

Calls 1

Int63Method · 0.80

Tested by 1

TestManyPeersFunction · 0.68