GetMD5ForString: don't hex
This commit is contained in:
@@ -421,7 +421,7 @@ RString CryptManager::GetMD5ForFile( RString fn )
|
|||||||
unsigned char digest[16];
|
unsigned char digest[16];
|
||||||
HashFile( file, digest, iHash );
|
HashFile( file, digest, iHash );
|
||||||
|
|
||||||
return BinaryToHex( digest, sizeof(digest) );
|
return RString( (const char *) digest, sizeof(digest) );
|
||||||
}
|
}
|
||||||
|
|
||||||
RString CryptManager::GetMD5ForString( RString sData )
|
RString CryptManager::GetMD5ForString( RString sData )
|
||||||
@@ -435,7 +435,7 @@ RString CryptManager::GetMD5ForString( RString sData )
|
|||||||
iRet = hash_descriptor[iHash].process( &hash, (const unsigned char *) sData.data(), sData.size() );
|
iRet = hash_descriptor[iHash].process( &hash, (const unsigned char *) sData.data(), sData.size() );
|
||||||
iRet = hash_descriptor[iHash].done( &hash, digest );
|
iRet = hash_descriptor[iHash].done( &hash, digest );
|
||||||
|
|
||||||
return BinaryToHex( digest, sizeof(digest) );
|
return RString( (const char *) digest, sizeof(digest) );
|
||||||
}
|
}
|
||||||
|
|
||||||
RString CryptManager::GetPublicKeyFileName()
|
RString CryptManager::GetPublicKeyFileName()
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ public:
|
|||||||
|
|
||||||
static void GetRandomBytes( void *pData, int iBytes );
|
static void GetRandomBytes( void *pData, int iBytes );
|
||||||
|
|
||||||
static RString GetMD5ForFile( RString fn ); // in Hex
|
static RString GetMD5ForFile( RString fn ); // binary
|
||||||
static RString GetMD5ForString( RString sData ); // in Hex
|
static RString GetMD5ForString( RString sData ); // in binary
|
||||||
|
|
||||||
static RString GetPublicKeyFileName();
|
static RString GetPublicKeyFileName();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ RString NetworkSyncManager::MD5Hex( const RString &sInput )
|
|||||||
RString HashedName;
|
RString HashedName;
|
||||||
RString PreHashedName;
|
RString PreHashedName;
|
||||||
|
|
||||||
RString sOutput = CryptManager::GetMD5ForString( sInput );
|
RString sOutput = BinaryToHex( CryptManager::GetMD5ForString(sInput) );
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
PreHashedName += ssprintf( "%2X", sOutput[i] );
|
PreHashedName += ssprintf( "%2X", sOutput[i] );
|
||||||
|
|||||||
@@ -761,7 +761,7 @@ void ScreenEvaluation::Input( const InputEventPlus &input )
|
|||||||
const HighScore &hs = STATSMAN->m_CurStageStats.m_player[pn].m_HighScore;
|
const HighScore &hs = STATSMAN->m_CurStageStats.m_player[pn].m_HighScore;
|
||||||
Screenshot screenshot;
|
Screenshot screenshot;
|
||||||
screenshot.sFileName = sFileName;
|
screenshot.sFileName = sFileName;
|
||||||
screenshot.sMD5 = CRYPTMAN->GetMD5ForFile( sPath );
|
screenshot.sMD5 = BinaryToHex( CRYPTMAN->GetMD5ForFile(sPath) );
|
||||||
screenshot.highScore = hs;
|
screenshot.highScore = hs;
|
||||||
pProfile->AddScreenshot( screenshot );
|
pProfile->AddScreenshot( screenshot );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user