MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Rand

Function Rand

pkg/util/bitarray/bitarray.go:513–522  ·  view source on GitHub ↗

Rand generates a random bit array of the specified length.

(rng *rand.Rand, bitLen uint)

Source from the content-addressed store, hash-verified

511
512// Rand generates a random bit array of the specified length.
513func Rand(rng *rand.Rand, bitLen uint) BitArray {
514 d := MakeZeroBitArray(bitLen)
515 for i := range d.words {
516 d.words[i] = rng.Uint64()
517 }
518 if len(d.words) > 0 {
519 d.words[len(d.words)-1] <<= (numBitsPerWord - d.lastBitsUsed)
520 }
521 return d
522}
523
524// Next returns the next possible bit array in lexicographic order.
525// The backing array of words is shared if possible.

Callers

nothing calls this directly

Calls 1

MakeZeroBitArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…