I have to find SHA1 output having 'zero' in first 8 places.
Output[40] = SHA1( Data[64] + Random[??] )
I cant figureout equation for generating random string to find required SHA1 in minimum iterations.
Random Generator
String GenRand()
{
String possibleCharacters("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); // change if require
int randomStringLength = 12; //8 // change if require
String randomString;
for(int i=0; i<randomStringLength; ++i)
{
int index = rand() % possibleCharacters.length();
Char nextChar = possibleCharacters.at(index);
randomString.append(nextChar);
}
return randomString;
}
Data[64]:
HOPETDtHmRghhwLNEdYJNKYSRdUIkoKAxfhaQQTtcSrKrlgjpQBRKAXyANYqtFFP
Random[??]:
awtVstgafWfa
Required Output[40]:
000000006259aa374ab4e1bb03074b6ec672cf99
Aucun commentaire:
Enregistrer un commentaire