_IsBase64 Autolt UDF


SUBMITTED BY: Guest

DATE: May 28, 2013, 8:23 a.m.

FORMAT: Text only

SIZE: 1.0 kB

HITS: 1303

  1. #include <Constants.au3>
  2. MsgBox($MB_SYSTEMMODAL, '', 'QXV0b0l0: ' & _IsBase64('QXV0b0l0'))
  3. MsgBox($MB_SYSTEMMODAL, '', 'SmFtZXM=: ' & _IsBase64('SmFtZXM='))
  4. MsgBox($MB_SYSTEMMODAL, '', 'LOLDJSKDJX: ' & _IsBase64('LOLDJSKDJX'))
  5. ; #FUNCTION# ====================================================================================================================
  6. ; Name ..........: _IsBase64
  7. ; Description ...: Check whether a string value is valid Base64
  8. ; Syntax ........: _IsBase64($sString)
  9. ; Parameters ....: $sString - Valid base64 string.
  10. ; Return values .: Success - True
  11. ; Failure - False
  12. ; Author ........: James
  13. ; Example .......: Yes
  14. ; ===============================================================================================================================
  15. Func _IsBase64($sString)
  16. Return StringRegExp($sString, "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") = 1
  17. EndFunc ;==>_IsBase64

comments powered by Disqus