盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

在jsp中作HTTP认证的方法

时间:2024/10/26作者:未知来源:盾怪网教程人气:

[摘要]end) int res; ...
end)
                        {
                                int res;
                                //this is a bit inefficient at the end point
                                //worth it for the small decrease in code size?
                                res=(enc[0]<<16)+(enc[1]<<8)+enc[2];
                                int b;
                                int lowestbit=18-(j*6);
                                for(int toshift=18;toshift>=lowestbit;toshift-=6)
                                {
                                        b=res>>>toshift;
                                        b&=63;
                                        if(b>=0&&b<26)
                                        sb.append((char)(b+65));
                                        if(b>=26&&b<52)
                                        sb.append((char)(b+71));
                                        if(b>=52&&b<62)
                                        sb.append((char)(b-4));
                                        if(b==62)
                                        sb.append(''+'');
                                        if(b==63)
                                        sb.append(''/'');
                                        if(sb.length()%76==0)
                                        sb.append(''\n'');
                                }
                                //now set the end chars to be pad character if there
                                //was less than integral input (ie: less than 24 bits)
                                if(end)
                                {
                                        if(j==1)
                                        sb.append("==");
                                        if(j==2)
                                        sb.append(''='');
                                }
                                enc[0]=0;enc[1]=0;enc[2]=0;
                                j=0;
                        }
                }
                return sb.toString();
        }
}



关键词:在jsp中作HTTP认证的办法




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版