MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / randomInt

Function randomInt

lib/core/common.py:1250–1266  ·  view source on GitHub ↗

Returns random integer value with provided number of digits >>> random.seed(0) >>> randomInt(6) 963638

(length=4, seed=None)

Source from the content-addressed store, hash-verified

1248 return int(randint(start, stop))
1249
1250def randomInt(length=4, seed=None):
1251 """
1252 Returns random integer value with provided number of digits
1253
1254 >>> random.seed(0)
1255 >>> randomInt(6)
1256 963638
1257 """
1258
1259 if seed is not None:
1260 _ = getCurrentThreadData().random
1261 _.seed(seed)
1262 choice = _.choice
1263 else:
1264 choice = random.choice
1265
1266 return int("".join(choice(string.digits if _ != 0 else string.digits.replace('0', '')) for _ in xrange(0, length)))
1267
1268def randomStr(length=4, lowercase=False, alphabet=None, seed=None):
1269 """

Callers 15

tableExistsFunction · 0.90
tableExistsThreadFunction · 0.90
_randomFillBlankFieldsFunction · 0.90
checkSqlInjectionFunction · 0.90
_Function · 0.90
checkSuhosinPatchFunction · 0.90
checkFilteredCharsFunction · 0.90
checkDynParamFunction · 0.90
checkWafFunction · 0.90
getPageMethod · 0.90
queryPageMethod · 0.90

Calls 4

getCurrentThreadDataFunction · 0.90
xrangeClass · 0.85
seedMethod · 0.80
replaceMethod · 0.45

Tested by 5

vulnTestFunction · 0.72
_orderByTechniqueFunction · 0.72
_fuzzUnionColsFunction · 0.72
dnsTestFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…