PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Convertir un code java en wlangage
Convertir un code java en wlangage
Débuté par Paul SOULAT, 07 juin 2023 15:36 - Aucune réponse
Membre enregistré
40 messages
Posté le 07 juin 2023 - 15:36
Bonjour à tous
j'aurais besoin de convertir un bout de code java en WLangage mais je n'y arrive pas si quelqu'un pouvait m'aider.

Voici le code java:
public static String generateKey(String codeEditeur,String idPS)
{
int tabConversion[]={164, 53, 184, 241, 134, 205, 51, 103, 70, 40, 54, 93, 166, 130, 250, 217, 24, 181, 3, 33, 210, 39, 125, 41, 10, 232, 62, 28, 207, 1, 255, 244, 63, 160, 146, 191, 153, 100, 82, 76, 0, 155, 104, 56, 144, 228, 225, 45, 159, 184, 248, 66, 69, 2, 17, 196, 15, 97, 211, 139, 246, 49, 129, 58, 5, 232, 158, 86, 249, 112, 11, 101, 68, 148, 204, 219, 77, 170, 31, 133, 149, 81, 71, 27, 235, 74, 171, 57, 238, 94, 132, 113, 222, 44, 233, 108, 227, 233, 75, 188, 254, 165, 92, 35, 20, 114, 106, 34, 25, 152, 161, 29, 117, 179, 192, 175, 221, 88, 7, 9, 138, 96, 4, 22, 236, 164, 214, 32, 212, 118, 6, 229, 201, 8, 55, 42, 131, 231, 26, 230, 252, 48, 53, 151, 87, 50, 180, 197, 91, 176, 239, 83, 16, 99, 19, 240, 127, 12, 172, 38, 203, 116, 173, 65, 47, 200, 163, 234, 80, 135, 208, 140, 115, 18, 85, 226, 182, 169, 126, 245, 84, 72, 168, 253, 78, 209, 147, 59, 136, 23, 220, 142, 218, 247, 185, 98, 13, 52, 206, 198, 150, 102, 79, 105, 187, 237, 186, 119, 36, 90, 107, 162, 109, 137, 30, 122, 194, 216, 223, 128, 195, 251, 21, 111, 190, 67, 224, 121, 120, 143, 157, 73, 177, 199, 141, 95, 213, 202, 46, 134, 61, 215, 89, 156, 178, 123, 37, 64, 110, 14, 183, 145, 193, 189, 60, 167};

SimpleDateFormat dateAnnee = new SimpleDateFormat("yyyy");
SimpleDateFormat dateMois = new SimpleDateFormat("MM");
SimpleDateFormat dateDay = new SimpleDateFormat("dd");
int annee=new Integer(dateAnnee.format(dateJour)).intValue();
int mois=new Integer(dateMois.format(dateJour)).intValue();
int jour=new Integer(dateDay.format(dateJour)).intValue();

// ATTENTION : // int mois = [1..12] et pas [01..12] – int jour = [1..31] et pas [01..31]
// valeur entière ! pas de zero devant

String idPSformat=idPS;
if (idPS==null || idPSformat.length()==0) idPSformat="NR";
String chaineACoder=mois+codeEditeur+idPSformat+annee+jour;
String chaineCodee="";
for (int i=0;i<chaineACoder.length();i++)

{
chaineCodee=chaineCodee+(int)(tabConversion[(int)(chaineACoder.substring(i,i+1).charAt(0))]);
}

String codeSecurite="";
for (int i=0;i<chaineCodee.length();i++)

{
if ((i+1)%3==0) codeSecurite+=chaineCodee.charAt(i);
}

System.out.println("CODE SECURITE : "+codeSecurite);
return codeSecurite;
};

Merci pour votre aide.