RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

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.

1
<?php 
2
/*
3
 Encoding Text With Base64URL
4
 http://www.beliefmedia.com/code/php-snippets/encoding-text-base64url
5
*/
6
 
7
function base64url_encode($s) {
8
    return str_replace(array('+', '/'), array('-', '_'), base64_encode($s));
9
}
10
 
11
function base64url_decode($s) {
12
    return base64_decode(str_replace(array('-', '_'), array('+', '/'), $s));
13
}

See also our Base64 online encoding tool.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment