惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
月光博客
月光博客
AI
AI
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
CXSECURITY Database RSS Feed - CXSecurity.com
WordPress大学
WordPress大学
GbyAI
GbyAI
L
Lohrmann on Cybersecurity
O
OpenAI News
Schneier on Security
Schneier on Security
P
Palo Alto Networks Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
W
WeLiveSecurity
L
LINUX DO - 最新话题
人人都是产品经理
人人都是产品经理
S
Security Affairs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
Arctic Wolf
Recorded Future
Recorded Future
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
G
GRAHAM CLULEY
N
Netflix TechBlog - Medium
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Scott Helme
Scott Helme
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Vercel News
Vercel News
The Hacker News
The Hacker News
Y
Y Combinator Blog
Latest news
Latest news
SecWiki News
SecWiki News
Hugging Face - Blog
Hugging Face - Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cisco Blogs
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
宝玉的分享
宝玉的分享
L
LINUX DO - 热门话题

博客园 - Amwpfiqvy

如何查看执行计划 SQL Server 堆表与栈表的对比(大表) SQL Server中CURD语句的锁流程分析 树表分级统计 SQL:查询购买了所有指定商品的人 在SQL Server中使用正则表达式 查看SQL Server性能时常用的性能计数器 SQL Server中行列转换 Pivot UnPivot Apq本地工具集 Apq.aspx 第一个:_Config.js JScript.Encode.js - Amwpfiqvy - 博客园 Apq.Threading.js - Amwpfiqvy - 博客园 Script/_Config.js Apq.js - Amwpfiqvy - 博客园 prototype.js Apq.aspx - Amwpfiqvy - 博客园 查看数据库所有用户表及其列信息 利用JScript的Literal Syntax特性用字符串表示对象
Apq.Text.js
Amwpfiqvy · 2006-06-14 · via 博客园 - Amwpfiqvy

     // 1110 xxxx    10xx xxxx    10xx xxxx
     case 14:
      var n2 = Bytes[i++];
      var n3 = Bytes[i++];
      str += String.fromCharCode( ((n & 0x0F) << 12) | ((n2 & 0x3F) << 6) | (n3 & 0x3F) );
      break;
    }
   }
   return str;
  }
 };
 
 Apq.Text.Base64Encoding = {
  strEncode: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  /// 将字符转为对应的Base64序号('='对应-1)
  getEncode: function( c ){
   var n = c.charCodeAt(0);
   if( n >= 65 && n <= 90 )
   {
    return n - 65;
   }
   else if( n >= 97 && n <= 122 )
   {
    return n - 71; // n - 97 + 26
   }
   else if( n >= 48 && n <= 57 )
   {
    return n + 4; // n - 48 + 52
   }
   else if( c == '+' )
   {
    return 62;
   }
   else if( c == '/' )
   {
    return 63;
   }
   else
   {
    return -1;
   }
  },
  
  /// 解码
  /// <str>Base64字符串</str>
  GetBytes: function( str, index, length, Bytes, bindex ){
   index = index || 0;
   length = length || str.length;
   Bytes = Bytes || new Array();
   bindex = bindex || 0;
   
   var i = 0;
   while( i < length )
   {
    var cary = new Array();
    for( var j = 0; j < 4; j++ )
    {
     cary.push( this.getEncode( str.charAt(index+i++) ) );
    }
    
    Bytes[bindex++] = (cary[0] << 2) | (cary[1] >>> 4);
    var n = ((cary[1] << 4) | (cary[2] >>> 2)) & 0xFF;
    if( n != 0xF )
    {
     Bytes[bindex++] = n;
     n = ((cary[2] << 6) | (cary[3] & 0x3F )) & 0xFF;
     if( n != 0x3F )
     {
      Bytes[bindex++] = n;
     }
    }
   }
   return Bytes;
  },
  /// 编码
  /// <Bytes>UFT8数组</Bytes>
  GetString: function( Bytes, index, length ){
   index = index || 0;
   length = length || Bytes.length;
   
   var ary = new Array();
   
   var nRest = length % 3;
   var i = 0; // 位置指针
   while( i < length - nRest )
   {
    var bary = new Array();
    for( var j = 0; j < 3; j++ )
    {
     bary.push( Bytes[index+i+j] );
    }
    var n = i/3*4;
    ary[n] = this.strEncode.charAt( bary[0] >>> 2 );
    ary[n+1] = this.strEncode.charAt( ((bary[0] << 4) | (bary[1] >>> 4)) & 0x3F );
    ary[n+2] = this.strEncode.charAt( ((bary[1] << 2) | (bary[2] >>> 6)) & 0x3F );
    ary[n+3] = this.strEncode.charAt( bary[2] & 0x3F );
    i += 3;
   }
   
   if( nRest )
   {
    var bary = new Array();
    for( var j = 0; j < nRest; j++ )
    {
     bary.push( Bytes[index+i+j] );
    }
    bary.push( 0 );
    
    var n = i/3*4;
    ary[n] = this.strEncode.charAt( bary[0] >>> 2 );
    ary[n+1] = this.strEncode.charAt( ((bary[0] << 4) | (bary[1] >>> 4)) & 0x3F );
    if( nRest == 2 )
    {
     ary[n+2] = this.strEncode.charAt( (bary[1] << 2) & 0x3F );
    }
   
    for( var j = 0; j < 3 - nRest; j++ )
    {
     ary.push( "=" );
    }
   }
   
   return ary.join("");
  }
 };
}