fox II/IDEC networks :: im.1404 :: / Re: php-нода | Login |
function b64c($s,$us) { if($us) return base64_encode($s); else return rtrim(strtr(base64_encode(zlib_encode($s)), '+/', '-_'), '='); } function b64d($s,$us) { $cnt = base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); if($us) return $cnt; else return zlib_decode($cnt); }
function b64c($s,$us) { if($us) return base64_encode($s); else return rtrim(strtr(base64_encode($s), '+/', '-_'), '='); } function b64d($s) { return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); } function hsh($s) { $s1 = b64c(hash("sha256",$s), 0); $s1=str_replace("-","A",$s1); $s1=str_replace("_","z",$s1); return substr($s1,0,20); }