8

urlencrypt

  1. require_once 'aesencrypt.php';
urlencodebase64
SYNOPSIS

urlencodebase64($s)

DESCRIPTION
CODE
  1. function urlencodebase64($s) {
  2.     return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($s));
  3. }
urldecodebase64
SYNOPSIS

urldecodebase64($s)

DESCRIPTION
CODE
  1. function urldecodebase64($s) {
  2.     $s64 = str_replace(array('-', '_' ),array('+', '/'), $s);
  3.  
  4.     $mod4 = strlen($s64) % 4;
  5.     if ($mod4) {
  6.         $s64 .= substr('====', $mod4);
  7.     }
  8.  
  9.     return base64_decode($s64);
  10. }
urlencrypt
SYNOPSIS

urlencrypt($s, $key)

DESCRIPTION
CODE
  1. function urlencrypt($s, $key) {
  2.     return urlencodebase64(aesencrypt($s, $key));
  3. }
urldecrypt
SYNOPSIS

urldecrypt($s, $key)

DESCRIPTION
CODE
  1. function urldecrypt($s64, $key) {
  2.     return rtrim(aesdecrypt(urldecodebase64($s64), $key));
  3. }
SEE ALSO

aesencrypt

Comments

To add a comment, click here.