在jsp中作HTTP认证的方法_MySQL
程序员文章站
2022-05-13 15:35:37
...
最近研究了jsp中作HTTP认证的问题,它的工作方式如下:
* We don''t try to stop the converion when we find the"="end of data padding char.
* We simply add zero bytes to the unencode buffer.
*/
public static String decode(String encoded)
{
StringBuffer sb=new StringBuffer();
int maxturns;
//work out how long to loop for.
if(encoded.length()%3==0)
maxturns=encoded.length();
else
maxturns=encoded.length()+(3-(encoded.length()%3));
//tells us whether to include the char in the unencode
boolean skip;
//the unencode buffer
byte[] unenc=new byte[4];
byte b;
*
End of data
* We don''t try to stop the converion when we find the"="end of data padding char.
* We simply add zero bytes to the unencode buffer.
*/
public static String decode(String encoded)
{
StringBuffer sb=new StringBuffer();
int maxturns;
//work out how long to loop for.
if(encoded.length()%3==0)
maxturns=encoded.length();
else
maxturns=encoded.length()+(3-(encoded.length()%3));
//tells us whether to include the char in the unencode
boolean skip;
//the unencode buffer
byte[] unenc=new byte[4];
byte b;
上一篇: php调用mysql存储过程和函数的方法_PHP教程
下一篇: 修复编程bug的12个关键步骤