挑战性的算法,谁能看明白???
wwyi 2003-12-12 11:48:09 算法如下:
ClientToSMS::fold(unsigned char Out[16])
{
UINT Output[4] = {0,0,0,0};
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{
Output[i]<<=8;
Output[i] |= Out[4*i+j];
}
}
otp[0] = Output[0] ^ Output[2];
otp[1] = Output[1] ^ Output[3];
CString temp;
OtpEnd.Format("%x", otp[0]);
if(OtpEnd.GetLength()<8)
{
for(int i=0; i<(8-OtpEnd.GetLength()); i++)
OtpEnd = "0" + OtpEnd;
}
temp.Format("%x", otp[1]);
if(temp.GetLength()<8)
{
for(int j=0; j<(8-temp.GetLength()); j++)
temp = "0" + temp;
}
OtpEnd += temp;
}
这个算法到底做了什么呢?