testing/clusterfuzz/common/fuzzy_types.py
def FuzzBase64InString(s):
  """Returns a string where Base64 components are fuzzed with FuzzyBuffer."""
  def ReplaceBase64(m):
    fb = FuzzyBuffer(base64.b64decode(m.group()))
    fb.RandomMutation()
    return base64.b64encode(fb)
  # This only matches obvious Base64 words with trailing equals signs
  return re.sub(r"(?<![A-Za-z0-9+/])"
                r"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)"
                r"(?![A-Za-z0-9+/])", ReplaceBase64, s)
Returns a string where Base64 components are fuzzed with FuzzyBuffer.
Returns a string where Base64 components are fuzzed with FuzzyBuffer.
Returns a string where Base64 components are fuzzed with FuzzyBuffer .
def FuzzBase64InString(s):
  def ReplaceBase64(m):
    fb = FuzzyBuffer(base64.b64decode(m.group()))
    fb.RandomMutation()
    return base64.b64encode(fb)
  return re.sub(r"(?<![A-Za-z0-9+/])"
                r"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)"
                r"(?![A-Za-z0-9+/])", ReplaceBase64, s)
def FuzzBase64InString ( s ) : def ReplaceBase64 ( m ) : fb = FuzzyBuffer ( base64 . b64decode ( m . group ( ) ) ) fb . RandomMutation ( ) return base64 . b64encode ( fb ) return re . sub ( r"(?<![A-Za-z0-9+/])" r"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)" r"(?![A-Za-z0-9+/])" , ReplaceBase64 , s )
Returns a string where Base64 components are fuzzed with FuzzyBuffer.
Returns a string where Base64 components are fuzzed with FuzzyBuffer .
"""Returns a string where Base64 components are fuzzed with FuzzyBuffer.""" # This only matches obvious Base64 words with trailing equals signs
s