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

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

博客园 - 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("");
  }
 };
}