mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-03-10 16:32:41 +08:00
17 lines
324 B
PHP
17 lines
324 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
function Qiniu_Encode($str) // URLSafeBase64Encode
|
||
|
|
{
|
||
|
|
$find = array('+', '/');
|
||
|
|
$replace = array('-', '_');
|
||
|
|
return str_replace($find, $replace, base64_encode($str));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function Qiniu_Decode($str)
|
||
|
|
{
|
||
|
|
$find = array('-', '_');
|
||
|
|
$replace = array('+', '/');
|
||
|
|
return base64_decode(str_replace($find, $replace, $str));
|
||
|
|
}
|