7
urlencrypt
- require_once 'aesencrypt.php';
urlencodebase64
SYNOPSIS
urlencodebase64($s)
DESCRIPTION
CODE
- function urlencodebase64($s) {
- return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($s));
- }
urldecodebase64
SYNOPSIS
urldecodebase64($s)
DESCRIPTION
CODE
- function urldecodebase64($s) {
- $s64 = str_replace(array('-', '_' ),array('+', '/'), $s);
- $mod4 = strlen($s64) % 4;
- if ($mod4) {
- $s64 .= substr('====', $mod4);
- }
- return base64_decode($s64);
- }
urlencrypt
SYNOPSIS
urlencrypt($s, $key)
DESCRIPTION
CODE
- function urlencrypt($s, $key) {
- return urlencodebase64(aesencrypt($s, $key));
- }
urldecrypt
SYNOPSIS
urldecrypt($s, $key)
DESCRIPTION
CODE
- function urldecrypt($s64, $key) {
- return rtrim(aesdecrypt(urldecodebase64($s64), $key));
- }
Commentaires