base64url package:base64

Tell whether a ByteString is encoded in padded or unpadded Base64url format. This function will also detect non-canonical encodings such as ZE==, which are externally valid Base64url-encoded values, but are internally inconsistent "impossible" values.

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether a ByteString is a valid Base64url format. This will not tell you whether or not this is a correct Base64url representation, only that it conforms to the correct shape. To check whether it is a true Base64 encoded ByteString value, use isBase64Url.

Examples:

>>> isValidBase64Url "PDw_Pj4="
True
>>> isValidBase64Url "PDw_Pj"
True
>>> isValidBase64Url "%"
False
Tell whether an untyped ByteString is Base64url-encoded.

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether an untyped ByteString is a valid Base64url format. This will not tell you whether or not this is a correct Base64url representation, only that it conforms to the correct shape. To check whether it is a true Base64 encoded ByteString value, use isBase64Url.

Examples:

>>> isValidBase64Url "PDw_Pj4="
True
>>> isValidBase64Url "PDw_Pj"
True
>>> isValidBase64Url "%"
False
Tell whether an untyped ShortByteString is Base64url-encoded.

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether an untyped ShortByteString is a valid Base64url format. This will not tell you whether or not this is a correct Base64url representation, only that it conforms to the correct shape. To check whether it is a true Base64 encoded ShortByteString value, use isBase64Url.

Examples:

>>> isValidBase64Url "PDw_Pj4="
True
>>> isValidBase64Url "PDw_Pj"
True
>>> isValidBase64Url "%"
False
Tell whether an untyped Text value is Base64url-encoded.

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether an untyped Text value is a valid Base64url format. This will not tell you whether or not this is a correct Base64url representation, only that it conforms to the correct shape. To check whether it is a true Base64 encoded Text value, use isBase64Url.

Examples:

>>> isValidBase64Url "PDw_Pj4="
True
>>> isValidBase64Url "PDw_Pj"
True
>>> isValidBase64Url "%"
False
Tell whether an untyped Text value is Base64url-encoded

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether an untyped ShortText value is Base64url-encoded.

Examples:

>>> isBase64Url "PDw_Pj4="
True
>>> isBase64Url "PDw_Pj4"
True
>>> isBase64Url "PDw_Pj"
False
Tell whether an untyped ShortText value is a valid Base64url format. This will not tell you whether or not this is a correct Base64url representation, only that it conforms to the correct shape. To check whether it is a true Base64 encoded ShortText value, use isBase64Url.

Examples:

>>> isValidBase64Url "PDw_Pj4="
True
>>> isValidBase64Url "PDw_Pj"
True
>>> isValidBase64Url "%"
False