GetMD5ForString: don't hex
This commit is contained in:
@@ -421,7 +421,7 @@ RString CryptManager::GetMD5ForFile( RString fn )
|
||||
unsigned char digest[16];
|
||||
HashFile( file, digest, iHash );
|
||||
|
||||
return BinaryToHex( digest, sizeof(digest) );
|
||||
return RString( (const char *) digest, sizeof(digest) );
|
||||
}
|
||||
|
||||
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].done( &hash, digest );
|
||||
|
||||
return BinaryToHex( digest, sizeof(digest) );
|
||||
return RString( (const char *) digest, sizeof(digest) );
|
||||
}
|
||||
|
||||
RString CryptManager::GetPublicKeyFileName()
|
||||
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
|
||||
static void GetRandomBytes( void *pData, int iBytes );
|
||||
|
||||
static RString GetMD5ForFile( RString fn ); // in Hex
|
||||
static RString GetMD5ForString( RString sData ); // in Hex
|
||||
static RString GetMD5ForFile( RString fn ); // binary
|
||||
static RString GetMD5ForString( RString sData ); // in binary
|
||||
|
||||
static RString GetPublicKeyFileName();
|
||||
};
|
||||
|
||||
@@ -830,7 +830,7 @@ RString NetworkSyncManager::MD5Hex( const RString &sInput )
|
||||
RString HashedName;
|
||||
RString PreHashedName;
|
||||
|
||||
RString sOutput = CryptManager::GetMD5ForString( sInput );
|
||||
RString sOutput = BinaryToHex( CryptManager::GetMD5ForString(sInput) );
|
||||
|
||||
for (int i = 0; i < 16; 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;
|
||||
Screenshot screenshot;
|
||||
screenshot.sFileName = sFileName;
|
||||
screenshot.sMD5 = CRYPTMAN->GetMD5ForFile( sPath );
|
||||
screenshot.sMD5 = BinaryToHex( CRYPTMAN->GetMD5ForFile(sPath) );
|
||||
screenshot.highScore = hs;
|
||||
pProfile->AddScreenshot( screenshot );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user