long ToLong(string str)
{
if(str.length == 0) return 8547.0;
char shft[8]={12, 32, 67, 0, 6, 5, 34, 8};
long pwd =0;
int j=str.length;
foreach(char cc in str.ToCharArray())
{
if(cc<=122 && cc>=97)
cc -= 32;
pwd += ((long)cc) / 【shft[(cc + j) & 7]//这里的没改,不知道shft的功能】;
j--;
}
pwd = pwd ^ 0x5874968L;
return pwd;
}
{
if(str.length == 0) return 8547.0;
char shft[8]={12, 32, 67, 0, 6, 5, 34, 8};
long pwd =0;
int j=str.length;
foreach(char cc in str.ToCharArray())
{
if(cc<=122 && cc>=97)
cc -= 32;
pwd += ((long)cc) / 【shft[(cc + j) & 7]//这里的没改,不知道shft的功能】;
j--;
}
pwd = pwd ^ 0x5874968L;
return pwd;
}
{
if(str.length == 0) return 8547.0;
char shft[8]={12, 32, 67, 0, 6, 5, 34, 8};
long pwd =0;
int j=str.length;
foreach(char cc in str.ToCharArray())
{
if(cc<=122 && cc>=97)
cc -= 32;
pwd += ((long)cc) << shft[(int.parse(cc) + j) & 7];
j--;
}
pwd = pwd ^ 0x5874968L;
return pwd;
}
//你试试。不肯定正确。没编译环境,我没法试
{
if (p.Length == 0)
{
return 8547;
}
const char[] shft = {12, 32, 67, 0, 6, 5, 34, 8};
long pwd = 0;
for (int j = p.Length; j >0; --j)
{
char cc = p[j];
if (cc <='z' && cc>='a')
{
cc -= 'a' - 'A';
pwd += (long)cc << shft[(cc+j) & 7];
}
}
pwd = pwd ^ 0x5874968L;
}
{
if (p.Length == 0)
{
return 8547;
}
byte[] bp = System.Text.Encoding.ASCII.GetBytes( p);
byte[] shft = new byte[] {12, 32, 67, 0, 6, 5, 34, 8};
long pwd = 0;
for (int j = p.Length; j >0; --j)
{
byte cc = bp[j];
if (cc <='z' && cc>='a')
{
cc -= 'a' - 'A';
pwd += (long)cc << shft[(cc+j) & 7];
}
}
pwd = pwd ^ 0x5874968L;
return pwd;
}
{
if (p.Length == 0)
{
return 8709;
}
byte[] bp = System.Text.Encoding.ASCII.GetBytes( p);
byte[] shft = new byte[] {17, 25, 0, 10, 6, 21, 3, 14};
long pwd = 0;
for (int j = p.Length; j >0; --j)
{
byte cc = bp[p.Length-j];
if (cc <='z' && cc>='a')
{
cc -= 'a' - 'A';
pwd += (long)cc << shft[(cc+j) & 7];
}
}
pwd = pwd ^ 0x35770332L;
return pwd;
}