MCPcopy Index your code
hub / github.com/nodejs/node / GenRandom

Function GenRandom

deps/v8/tools/bigint-tester.py:49–59  ·  view source on GitHub ↗
(length, negative=kRandom)

Source from the content-addressed store, hash-verified

47}"""
48
49def GenRandom(length, negative=kRandom):
50 if length == 0: return "0n"
51 s = []
52 if negative == kYes or (negative == kRandom and (random.randint(0, 1) == 0)):
53 s.append("-") # 50% chance of negative.
54 s.append("0x")
55 s.append(kChars[random.randint(1, kBase - 1)]) # No leading zero.
56 for i in range(1, length):
57 s.append(kChars[random.randint(0, kBase - 1)])
58 s.append("n")
59 return "".join(s)
60
61def Parse(x):
62 assert x[-1] == 'n', x

Callers 3

GenerateInputMethod · 0.85
GenerateInputsMethod · 0.85

Calls 3

rangeFunction · 0.50
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…