Home Encoding Text With Base64URL

    Encoding Text With Base64URL


    Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. Each base64 digit represents exactly 6 bits of data (Source: Wikipedia ).

    The passage of Base64 encoded strings isn’t ideal in URLs because, while the Base64 alphabet includes A-Z, a-z, and 0-9, it also includes + and /… potentially returning erroneous results when used in a URL. As recommended by RFC 4648 , a Base64URL string (replacing the \ and + with _ and ) can be created using the functions described below. They’re referenced in a number of our articles.

    See also our Base64 online encoding tool.

    Short URL for this post: http://shor.tt/1XU9