GetMD5ForString: don't hex

This commit is contained in:
Glenn Maynard
2007-01-26 04:35:15 +00:00
parent 961eae77a3
commit abe62b0920
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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();
};
+1 -1
View File
@@ -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] );
+1 -1
View File
@@ -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 );
}