MCPcopy Index your code
hub / github.com/Bashfuscator/Bashfuscator / probibility

Method probibility

bashfuscator/core/engine/random.py:81–91  ·  view source on GitHub ↗

Return True a certain percentage of the time. :param prob: probability of returning True :type prob: int :returns: True prob percent of the time, False otherwise

(self, prob)

Source from the content-addressed store, hash-verified

79 return self.randGenNum(0, max - 1)
80
81 def probibility(self, prob):
82 """
83 Return True a certain percentage of the time.
84
85 :param prob: probability of returning True
86 :type prob: int
87 :returns: True prob percent of the time, False otherwise
88 """
89 randNum = self.randGenNum(0, 100)
90
91 return randNum <= prob
92
93 def randSelect(self, seq):
94 """

Callers 9

mutateMethod · 0.80
mutateMethod · 0.80
genSymbolAlphabetStrMethod · 0.80
_mangleBinaryMethod · 0.80
_getRandCharsMethod · 0.80
_getCommandTerminatorMethod · 0.80
getFinalPayloadMethod · 0.80

Calls 1

randGenNumMethod · 0.95

Tested by

no test coverage detected