Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Base64Url.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Security;
3 
9 class Base64Url {
10 
17  public static function encode($bytes) {
18  $bytes = base64_encode($bytes);
19  $bytes = rtrim($bytes, '=');
20  return strtr($bytes, '+/', '-_');
21  }
22 
29  public static function decode($bytes) {
30  $bytes = strtr($bytes, '-_', '+/');
31  return base64_decode($bytes);
32  }
33 }
Encode and decode Base 64 URL.
Definition: Base64Url.php:9
static decode($bytes)
Decode base 64 URL.
Definition: Base64Url.php:29
static encode($bytes)
Encode base 64 URL.
Definition: Base64Url.php:17