RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts</strong | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.69% (5.89%*) • Home Loan Fixed: 5.39% (6.59%*) • Fixed: 5.39% (6.59%*) • Variable: 5.69% (5.89%*) • Investment IO: 5.69% (6.48%*) • Investment PI: 5.39% (6.59%*)

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 complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

Like this article?

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

Leave a comment