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

Function randomStr

lib/core/common.py:1268–1291  ·  view source on GitHub ↗

Returns random string value with provided number of characters >>> random.seed(0) >>> randomStr(6) 'FUPGpY'

(length=4, lowercase=False, alphabet=None, seed=None)

Source from the content-addressed store, hash-verified

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 """
1270 Returns random string value with provided number of characters
1271
1272 >>> random.seed(0)
1273 >>> randomStr(6)
1274 'FUPGpY'
1275 """
1276
1277 if seed is not None:
1278 _random = getCurrentThreadData().random
1279 _random.seed(seed)
1280 choice = _random.choice
1281 else:
1282 choice = random.choice
1283
1284 if alphabet:
1285 retVal = "".join(choice(alphabet) for _ in xrange(0, length))
1286 elif lowercase:
1287 retVal = "".join(choice(string.ascii_lowercase) for _ in xrange(0, length))
1288 else:
1289 retVal = "".join(choice(string.ascii_letters) for _ in xrange(0, length))
1290
1291 return retVal
1292
1293def sanitizeStr(value):
1294 """

Callers 15

tableExistsFunction · 0.90
columnExistsFunction · 0.90
fileExistsFunction · 0.90
_randomFillBlankFieldsFunction · 0.90
checkSqlInjectionFunction · 0.90
heuristicCheckDbmsFunction · 0.90
checkWafFunction · 0.90
_goInferenceFunction · 0.90
getPageMethod · 0.90
queryPageMethod · 0.90
checkCharEncodingFunction · 0.90

Calls 3

getCurrentThreadDataFunction · 0.90
xrangeClass · 0.85
seedMethod · 0.80

Tested by 3

vulnTestFunction · 0.72
_fuzzUnionColsFunction · 0.72
_unionPositionFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…