Bonjour à tous !

J'ai un petit soucis avec une fonction. Je souhaite pouvoir recupérer une un hash que j'ai crée depuis l'algorythme SHA-1.
la fonction doit renvoyer un std::string.

j'ai à l'arrivé un tableau h[0],h[1],h[2],h[3],h[4].
je voudrais mettre tout le contenu des cases du tableau à la suite puis le renvoyer de la fonction.

mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
std::string hash(string nom, string taille)
{
    // déclaration des variables
    union u_init init;
    // mise en place du mots
    z = 0;
    mot = nom+taille;
    i = 8*9;.....................................................
 
        h[0] = h[0]+a;
        h[1] = h[1]+b;
        h[2] = h[2]+c;
        h[3] = h[3]+d;
        h[4] = h[4]+e;
        retour = ??????????????;
        }
        t = t+1;
    }
return retour;  
}
 
int main(void)
{
 string nom;
 string taille;
 std::cout << "nom du fichier: " << endl;
 std::cin >> nom;
 std::cout << "taille du fichier: " << endl;
 std::cin >> taille;
 std::cout << "\nHASH du fichier: " << endl;
 hash(nom, taille);
 std::cout << retour << endl;
 system("PAUSE");
 return EXIT_SUCCESS;    
}
j'ai essayé plusieures methode mais impossible de recuperer correctement la variable (j'en ai besoin pour faire une dll pour delphi par la suite).

Merci d'avanc epour votre aide