K
karmalax
public static string Somme(string T)
{
string text1 = "";
double num5 = Strings.Len(T) + 1;
int num3 = 7;
int num6 = Strings.Len(T);
int num1 = 1;
while (num1 <= num6)
{
double num4 = Strings.Asc(Strings.Mid(T, num1, 1)) + (num3
- num1);
int num2 = (int) Math.Round((double) ((num4 % 10) + 1));
if (num2 == 0)
{
num2 = 1;
}
num3 = num2 + 5;
num4 = ((long) Math.Round((double) (num4 * num2))) /
((long) (num2 * 2));
num5 = ((long) Math.Round((double) (num5 * num4))) /
((long) num2);
if (num4 < 1)
{
num4 = 4;
}
if (num5 > 900000)
{
num5 = ((long) Math.Round(num5)) / ((long)
Math.Round(num4));
}
num1++;
}
text1 = Strings.Left(Strings.LTrim(Conversion.Str(num5)) +
"12345678", 8);
text1 = Strings.Right(text1, 4) + Strings.Left(text1, 4);
num1 = (int) Math.Round((double) (8 -
Conversion.Val(Strings.Mid(T, 1, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 1, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(T, 6, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 6, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (9 -
Conversion.Val(Strings.Mid(text1, 2, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 4, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (7 -
Conversion.Val(Strings.Mid(text1, 3, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 8, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(text1, 5, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 7, 1,
Strings.Trim(Conversion.Str(num1)));
return text1;
}
Thanks
{
string text1 = "";
double num5 = Strings.Len(T) + 1;
int num3 = 7;
int num6 = Strings.Len(T);
int num1 = 1;
while (num1 <= num6)
{
double num4 = Strings.Asc(Strings.Mid(T, num1, 1)) + (num3
- num1);
int num2 = (int) Math.Round((double) ((num4 % 10) + 1));
if (num2 == 0)
{
num2 = 1;
}
num3 = num2 + 5;
num4 = ((long) Math.Round((double) (num4 * num2))) /
((long) (num2 * 2));
num5 = ((long) Math.Round((double) (num5 * num4))) /
((long) num2);
if (num4 < 1)
{
num4 = 4;
}
if (num5 > 900000)
{
num5 = ((long) Math.Round(num5)) / ((long)
Math.Round(num4));
}
num1++;
}
text1 = Strings.Left(Strings.LTrim(Conversion.Str(num5)) +
"12345678", 8);
text1 = Strings.Right(text1, 4) + Strings.Left(text1, 4);
num1 = (int) Math.Round((double) (8 -
Conversion.Val(Strings.Mid(T, 1, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 1, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(T, 6, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 6, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (9 -
Conversion.Val(Strings.Mid(text1, 2, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 4, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (7 -
Conversion.Val(Strings.Mid(text1, 3, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 8, 1,
Strings.Trim(Conversion.Str(num1)));
num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(text1, 5, 1))));
if (num1 < 0)
{
num1 += 9;
}
StringType.MidStmtStr(ref text1, 7, 1,
Strings.Trim(Conversion.Str(num1)));
return text1;
}
Thanks