File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -913,8 +913,8 @@ def safeStringFormat(formatStr, params):
913913
914914 return retVal
915915
916- def sanitizeAsciiString (string ):
917- return "" .join (char if ord (char ) < 128 else '?' for char in string )
916+ def sanitizeAsciiString (subject ):
917+ return "" .join (char if ord (char ) < 128 else '?' for char in subject )
918918
919919def decloakToNamedTemporaryFile (filepath , name = None ):
920920 retVal = NamedTemporaryFile ()
@@ -952,3 +952,9 @@ def posixToNtSlashes(filepath):
952952
953953def ntToPosixSlashes (filepath ):
954954 return filepath .replace ('\\ ' , '/' )
955+
956+ def isBase64EncodedString (subject ):
957+ return re .match (r"\A(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z" , subject ) is not None
958+
959+ def isHexEncodedString (subject ):
960+ return re .match (r"\A[0-9a-fA-F]+\Z" , subject ) is not None
You can’t perform that action at this time.
0 commit comments