Added function GetCrc32ForString.

This commit is contained in:
Peter S. May
2002-07-12 06:45:56 +00:00
parent eda27e2a21
commit 31cb5e8260
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -286,6 +286,16 @@ void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bRe
::FindClose( hFind );
}
//-----------------------------------------------------------------------------
// Name: GetCrc32ForString( CString s)
// Desc: Coerces CString into an unsigned char array and runs CRC-32 on it.
//-----------------------------------------------------------------------------
unsigned int GetCrc32ForString( CString s )
{
// A CString has built in length data! Isn't that great?
return GetCrc32((unsigned char*)s.GetBuffer(s.GetLength()), s.GetLength());
}
//-----------------------------------------------------------------------------
// Name: GetHashForString( CString s )
// Desc: This new version of GetHashForString uses a stronger hashing algorithm
+1
View File
@@ -98,6 +98,7 @@ CString join(
void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false );
int GetHashForString( CString s );
unsigned int GetCrc32ForString( CString s );
int GetHashForFile( CString sPath );
int GetHashForDirectory( CString sDir ); // a hash value that remains the same as long as nothing in the directory has changed