国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? php教程 php手冊(cè) 一個(gè)雙向加密解密法(php)

一個(gè)雙向加密解密法(php)

Jun 21, 2016 am 09:16 AM
gt nbsp str this

加密|解密

基于進(jìn)制轉(zhuǎn)換的


//made by huyang @2005-01-20||11-04-06
##用n進(jìn)位制到m進(jìn)位制
##0~9A-Z,最多可理解為36進(jìn)制范圍
print'

加密解密法';
class carry
? {
??? function carry($n,$m)
????? {
?$this->n=$n;
?$this->m=$m;
?$this->chn['0']=0;
?$this->chn['1']=1;
?$this->chn['2']=2;
?$this->chn['3']=3;
?$this->chn['4']=4;
??????? $this->chn['5']=5;
??????? $this->chn['6']=6;
??????? $this->chn['7']=7;
??????? $this->chn['8']=8;
??????? $this->chn['9']=9;
??????? $this->chn['A']=10;
??????? $this->chn['B']=11;
??????? $this->chn['C']=12;
??????? $this->chn['D']=13;
??????? $this->chn['E']=14;
??????? $this->chn['F']=15;
??????? $this->chn['G']=16;
??????? $this->chn['H']=17;
??????? $this->chn['I']=18;
??????? $this->chn['J']=19;
??????? $this->chn['K']=20;
??????? $this->chn['L']=21;
??????? $this->chn['M']=22;
??????? $this->chn['N']=23;
??????? $this->chn['O']=24;
??????? $this->chn['P']=25;
??????? $this->chn['Q']=26;
??????? $this->chn['R']=27;
??????? $this->chn['S']=28;
??????? $this->chn['T']=29;
??????? $this->chn['U']=30;
??????? $this->chn['V']=31;
??????? $this->chn['W']=32;
??????? $this->chn['X']=33;
??????? $this->chn['Y']=34;
??????? $this->chn['Z']=35;
??????? $this->cn[0]='0';
??????? $this->cn[1]='1';
??????? $this->cn[2]='2';
??????? $this->cn[3]='3';
??????? $this->cn[4]='4';
??????? $this->cn[5]='5';
??????? $this->cn[6]='6';
??????? $this->cn[7]='7';
??????? $this->cn[8]='8';
??????? $this->cn[9]='9';
??????? $this->cn[10]='A';
??????? $this->cn[11]='B';
??????? $this->cn[12]='C';
??????? $this->cn[13]='D';
??????? $this->cn[14]='E';
??????? $this->cn[15]='F';
??????? $this->cn[16]='G';
??????? $this->cn[17]='H';
??????? $this->cn[18]='I';
??????? $this->cn[19]='J';
??????? $this->cn[20]='K';
??????? $this->cn[21]='L';
??????? $this->cn[22]='M';
??????? $this->cn[23]='N';
??????? $this->cn[24]='O';
??????? $this->cn[25]='P';
??????? $this->cn[26]='Q';
??????? $this->cn[27]='R';
??????? $this->cn[28]='S';
??????? $this->cn[29]='T';
??????? $this->cn[30]='U';
??????? $this->cn[31]='V';
??????? $this->cn[32]='W';
??????? $this->cn[33]='X';
??????? $this->cn[34]='Y';
??????? $this->cn[35]='Z';
????? }
??? function check1($a)
????? {
?if(ereg("[0-9]",$a))
?? if($a>=2)
???? if($a?????? return true;
?return false;
????? }
??? function check2($a)
????? {
?$la=0;
?for($j=0;$j?? {
???? if($this->chn[substr($a,$j,1)]>=$this->n)
?????? $la=1;
???? if($la)
?????? break;
?? }
?if($la)
?? return false;
?else
?? return true;
????? }
??? function toDEC($a)//$n->十進(jìn)制
????? {
?if($this->n==10)
?? return $a;
?else
?? {
???? $a=strrev($a);
???? $k=0;
???? for($i=0;$i?????? {
??$k+=$this->chn[substr($a,$i,1)]*pow($this->n,$i);
?????? }
???? return $k;
?? }
????? }
??? function gethigh($a)
????? {
?if($a?? return 1;
?else
?? {
???? for($i=0;$i?????? {
??if(pow($this->m,$i)>$a)
??? break;
?????? }
???? return $i;
?? }
????? }
??? function toM($a)//十進(jìn)制->$m
????? {
?$a1=$this->gethigh($a);
?$res="";
?for($i=1;$i?? {
???? $u=($a-$a%pow($this->m,($a1-$i)))/(pow($this->m,($a1-$i)));
???? $a-=$u*pow($this->m,($a1-$i));
???? $res.=$this->cn[$u];
?? }
?return $res;
????? }
??? function get($a)
????? {
?if(!$this->n)$this->n=10;
?if(!$this->m)$this->m=10;
?if(($this->check1($this->n))&&($this->check1($this->m)))
?? {
???? if(ereg("[0-9A-Z]",$a))
?????? {
??if($this->check2($a))
??? {
????? return $this->toM($this->toDEC($a));
??? }
??else
??? return false;
?????? }
???? else
?????? return false;
?? }
?else
?? return false;
????? }
? }
class han
? {
??? function han()
????? {
?for($i=0;$i?? {
???? $this->hu1[$i]=$i;
???? $this->hu2[$i]=$i;
?? }
?for($i=10;$i?? {
???? $this->hu1[$i]=chr($i+55);
???? $this->hu2[chr($i+55)]=$i;
?? }
?for($i=36;$i?? {
???? $this->hu1[$i]=chr($i+61);
???? $this->hu2[chr($i+61)]=$i;
?? }
?$this->hu1[62]=chr(42);
?$this->hu1[63]=chr(43);
?$this->hu2[chr(42)]=62;
?$this->hu2[chr(43)]=63;
????? }
??? function tocode($str)//將一組字符轉(zhuǎn)變成為代碼0~65536
????? {
?$huyang1=new carry(10,33);
?$j=0;
??????? for($i=0;$i?? {
??????????? $p=ord(substr($str,$i,1));
??????????? if($p>160)
?????? {
??????????????? $q=ord(substr($str,++$i,1));
??????????????? $p=$p*256+$q;
????????????? }
??????????? else
?????? $p=255*256+$p;
???? $ret.=$huyang1->get($p);
???? $j++;
????????? }
??????? return $ret;
????? }
??? function getcode($str)
????? {
?$huyang=new carry(33,10);
?$res="";
?for($i=0;$i?? {
???? $a=$huyang->get(substr($str,($i*4),4));
???? $a2=$a%256;
???? $a1=($a-$a2)/256;
???? if($a1==255)
?????? $res.=chr($a2);
???? else
?????? $res.=chr($a1).chr($a2);
?? }
?return $res;
????? }
??? function encode($str)
????? {
?$res="";
?$huyang=new carry(35,7);
?$huyang1=new carry(8,10);
?$str1=$this->tocode($str);
?$k=ceil(strlen($str1)/3);
?for($i=0;$i?? {
???? $word=$this->hu1[rand(0,61)];
???? $res1=$huyang1->get($huyang->get(substr($str1,($i*3),3)));
???? $res11=($res1-$res1%(64*64))/(64*64);
???? $res1-=$res11*64*64;
???? $res12=($res1-$res1%64)/64;
???? $res1-=$res12*64;
???? $res13=$res1;
???? if($i==($k-1))
?????? {
??if($res11!=0)
??? {
????? $res.=$this->hu1[$res11].$this->hu1[$res12].$this->hu1[$res13].$word;
??? }
??elseif($res12!=0)
??? {
??????????????????? $res.=$this->hu1[$res12].$this->hu1[$res13].$word;
??? }
??elseif($res13!=0)
??? {
??????????????????? $res.=$this->hu1[$res13].$word;
??? }
?????? }
???? else
?????? $res.=$this->hu1[$res11].$this->hu1[$res12].$this->hu1[$res13].$word;
?? }
?return trim($res);
????? }
??? function discode($str)
????? {
?$len=ceil(strlen($str)/4);
?$res="";
?$a=strlen($str)-4*($len-1);
?for($i=0;$i?? {
???? if($i!=($len-1))
?????? {
???????? $res1=substr($str,$i*4,1);
???????? $res2=substr($str,($i*4+1),1);
???????? $res3=substr($str,($i*4+2),1);
???????? $res11=$this->hu2[$res1];
???????? $res12=$this->hu2[$res2];
???????? $res13=$this->hu2[$res3];
???????? $res14=$res11*64*64+$res12*64+$res13;
???????? $res.=" ".$res14;
?????? }
???? else
?????? {
??if($a%4==0)
??? {
??????????????????? $res1=substr($str,$i*4,1);
???????????? $res2=substr($str,($i*4+1),1);
???????????? $res3=substr($str,($i*4+2),1);
??????????????????? $res11=$this->hu2[$res1];
???????????? $res12=$this->hu2[$res2];
???????????? $res13=$this->hu2[$res3];
???????????? $res14=$res11*64*64+$res12*64+$res13;
???????????? $res.=" ".$res14;
??? }
??elseif($a%4==2)
??? {
??????????????????? $res1=substr($str,$i*4,1);
???????????? $res11=$this->hu2[$res1];
???????????? $res14=$res11;
???????????? $res.=" ".$res14;
??? }
??elseif($a%4==3)
??? {
??????????????????? $res1=substr($str,$i*4,1);
???????????? $res2=substr($str,($i*4+1),1);
???????????? $res11=$this->hu2[$res1];
???????????? $res12=$this->hu2[$res2];
???????????? $res14=$res11*64+$res12;
???????????? $res.=" ".$res14;
??? }
?????? }
?? }
?return trim($res);
????? }
??? function decode($str)
????? {
?$str=$this->discode($str);
?$a=explode(" ",$str);
?$res="";
?$huyang=new carry(7,35);
?$huyang1=new carry(10,8);
?for($i=0;$i?? {
??????????? //$res.=$huyang->get($a[$i]);
??????????? if($i==(count($a)-1))
?????? $res.=$huyang->get($huyang1->get($a[$i]));
???? else
?????? {
??$b=$huyang->get($huyang1->get($a[$i]));
??if(strlen($b)==0)
??? $res.="000";
??elseif(strlen($b)==1)
??? $res.="00".$b;
??elseif(strlen($b)==2)
??? $res.="0".$b;
??else
??? $res.=$b;
?????? }
?? }
?return $this->getcode($res);
????? }
? }
$s=microtime();
$st=explode(' ',$s);
$st1=$st[0];
$st2=$st[1];
$huyang=new han;
$str=$_POST['str'];
if(!$str)$str="請(qǐng)輸入查詢語(yǔ)句!!";
$len=strlen($str);
if($submit)
? $a=$huyang->encode($str);
if($submit1)
? $a=$huyang->decode($str);
$a=str_replace("\\","\",$a);
$a=str_replace("\\"","\"",$a);
$a=str_replace("\\'","\'",$a);
$s=microtime();
$st=explode(' ',$s);
$sta=$st[0];
$stb=$st[1];
$ss1=$sta-$st1;
$ss2=$stb-$st2;
$cus=$ss1+$ss2;
$cus1=$cus/$len;
?>

?
?
?????
?????
???
???
?????
?????
???
???
?????
?????
???
?
耗費(fèi)時(shí)間/字長(zhǎng)-(平均耗時(shí))
原始語(yǔ)句
結(jié)果

?


?


????   




? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1600
29
PHP ????
1502
276
???
Windows 11?? ? ??? ??? ???? ??: ?? ? ?? ?? Windows 11?? ? ??? ??? ???? ??: ?? ? ?? ?? Sep 22, 2023 am 11:37 AM

Windows 11? ???? ??? ???? ??? ??????. ???? ?????? ?? ? ???? ?? ??? ?? ??? ????? ??? ? ????. ? ?????? Windows ?? ???? ??? ???? ???? ??? ??? ? ??? ?? ??? ??? ?????. ? ??? ??? ???? ??? ?????? +? ?? ?? ?? ???. Windows?? ???? ???? ?? ??? ?????. ?? ?? ? ??? ?? ? 11" Width="643" Height="500" > ?? ??? ? ? ???? ?? ?? ?? ??? ?? ?? ?? ???? ?????. ?? ?? ? ?? ???? ?? ??? ????? ?? ??? ?? ???? ?? ??? ????? ?? ??? ?? ???? ?? ??? ???.

?? ??: ???? PIN ??? ?????. ?? ??: ???? PIN ??? ?????. Oct 04, 2023 pm 05:45 PM

??? ??? "??? ???? PIN ??? ?????"?? ???? ?????. ?? ?? ??? ??? ? ?? ?? ?? ?? ??? ???? ????? PIN ?? ??? ??? ?? ?????. ??? ?? ??? ???? Windows? ???? ?? ?????? ?? ???? ???? ????. ?? ?? ?? ????. ??? ??? ???? ???? ?? ??? ???? ?????. ???? Windows 11?? PIN? ????? ???? ??? ?????? ??? ??? ??? ???? ?? ? ???? ?? ???? ?? ?? ?? ?????. ??? ????? ???? ??? ? ? ????! ?? ?? ??? ?? ?? ???? ??? ????? ?? ?? ??? ??? ? ????. ?? ??

Windows 11?? ?? ??? ??? ???? ??? ?????? Windows 11?? ?? ??? ??? ???? ??? ?????? Sep 14, 2023 pm 03:33 PM

????? Windows 11? ?? ??? ??? ??? ???/?? ??? ?? ????. ??? ??? ???? ??? ? ????. ? ?????? ?? ???? ???? ??? ????? ????? ????? ??? ? ?? ??? ?? ??? ??? ?????. ?? ?? ??? ?? ?? ??? ??? ??? ? ????? ?, ?? ?? ???? ?? ?? ?? ??? ??? ????? ????? ???? ???? ??? ?? ?? ??? ??? ??? ? ????. ??? ??? ????? ?? ???? ?????. Windows 11?? ?? ??? ??? ???? ??? ?????? 1. ?? ?? ???? +? ?? ?? ?? ???. Windows"?? ??"?? ??? ??

Windows 11?? ?? ??? ??? ?? ??? ??? ?? ?????? ?? Windows 11?? ?? ??? ??? ?? ??? ??? ?? ?????? ?? Sep 15, 2023 pm 03:57 PM

?? ??? ???? ???? ?? ??? ??? ???? ??? ???? ? ?? ????. ? ?? ?? ??? ?? ???? ????? ???? ??? ??? ?? ? ? ??? ?? ????. ? ?? ??? ? ?? ??? ???? ????? ????. ??? ??? ???? ?? ? ?? ??? ?? ??? ?????? ??? ????????. ??? ???? ??? ?? ??? ? ?? ?? ??? ??? ?? ???? ? ????. Windows 11?? ?? ??? ??? ?? ??? ????? ??? ?????? 1. ?? ?? ???? ?? ??? ??? ?????. Windows??? ???? ???? ??? ?????. ?? ??? ??? ?????. ?? ??? ???? ?? ???? ??? ?????. "?? ??"? ?????.

Windows 11/10 ??? OOBELANGUAGE ?? ?? Windows 11/10 ??? OOBELANGUAGE ?? ?? Jul 16, 2023 pm 03:29 PM

Windows Installer ???? "OOBELANGUAGE" ?? ?? "??? ??????."? ?????? ??? ??? ?? Windows ??? ???? ??? ????. OOBE? ?? ?? ??? ??? ?????. ?? ????? ? ? ??? ?? OOBE ?? ??? ??? ?????. ??? ??? ????. OOBE ?? ???? ?????? ???? ? ??? ??? ? ????. ?? ?? – 1. OOBE ? ??? ?? “?? ??” ??? ?????. ??? ? ??? ?? ?? ????? ?????. 2. ?? ??? ???? ???? ?? ?????. ???? ?? ??? ? OOBE? ????? ???. 3. ????? ??? ??? ????. ???? ???? OOBE? ?? ??? ?????.

Windows 11?? ??? ???? 10?? ?? Windows 11?? ??? ???? 10?? ?? Dec 18, 2023 pm 02:21 PM

?? ??? ?? ??? ??? ??? ? ???? ????, ?? ??? ??? ? ? ?? ?????. ?? ??? ???, ???? ???, ???? ?? ????? ?? ? ??? ???. ??? ??? ?? ?? ??? ??? ? ???, ?? ??? UI ??? ??? Windows 11??? ?? ?????. ??? ???? ? ??? ?? ?? Windows 11?? ??? ???? ?? ??? ??? ????. Windows 11?? ??? ???? ?? [10?? ??] ?? ??? ???? ?? ??? ???? Windows 11?? ??? ??? ? ????. ???? ?? ???? ???? ???? ???? ???? ?????. ????. ?? 1: ?? ?? ?? ?? ??? ???? ? ????.

Windows 11? ????? ?? ?? ??? Windows 11? ????? ?? ?? ??? Sep 19, 2023 pm 06:45 PM

Windows 11? ????? ?? ??? ???? ?? ??? ?? ?? ???? ??? ????. ? ???? ???? ??? ??, ?? ???? ???? ??? ????. ??? ??? ?? ??? ????? ??? ??? ?????. ??? ?? ?? ???? ???? ??? ?? ??? ?? ? ???? ???? ? ???? ??? ??? ??? ????? ?? ??? ???? ??? ??? ???. Custom Zoom? ??: ??? ???? ?? ??? ????? ??? ?????. ? ?? ???? ? ?? ?? ? ? ??? ?????. ?? ??? ? ?? ?????? ???? ??? ?? ?? ???? ??? ? ????. ??? ????? ??? ????? ? ??? ? ? ????. ?? ?? ??? ??? ? ????? ??? ? ????. ??? 11? ???? ??

Windows Server?? ??? ?? ?? 0xc004f069? ???? ?? Windows Server?? ??? ?? ?? 0xc004f069? ???? ?? Jul 22, 2023 am 09:49 AM

Windows? ?? ?? ?????? ??? ? ?? ?? 0xc004f069? ??? ?? ???? ???? ??? ????. ??? ????? ????? ?????? Windows Server? ???? ?? ?? ????? ? ??? ??? ? ????. ??? ?? ??? ???? ??? ???? ??? ?? ??? ?? ?? ???? ???? ??? ??????. ?? ?? - ?? ???? ??? ?? ????. ?? ?? ???? ?? ??????. Windows ?? ?? ????? ???? ?? ?????. ?? 1 – ????? ??? cmd ????? Windows Server Edition ???? ??????. 1?? – Windows Server ?? ?? ?? ???? ?? W ??? ???? ???.

See all articles