Function isBase64

  • check whether a string is a base64 encoded string or not

    Parameters

    • s: string

      string to be checked

    Returns boolean

    true if the string is a Base64 encoded string

    See

    isBase64URL

    Example

    isBase64("YWE=") -> true
    isBase64("YW_=") -> false
    isBase64("YWE") -> false // length shall be multiples of 4