Added function GetCrc32ForString.
This commit is contained in:
@@ -286,6 +286,16 @@ void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bRe
|
|||||||
::FindClose( hFind );
|
::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 )
|
// Name: GetHashForString( CString s )
|
||||||
// Desc: This new version of GetHashForString uses a stronger hashing algorithm
|
// Desc: This new version of GetHashForString uses a stronger hashing algorithm
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ CString join(
|
|||||||
|
|
||||||
void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false );
|
void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false );
|
||||||
int GetHashForString( CString s );
|
int GetHashForString( CString s );
|
||||||
|
unsigned int GetCrc32ForString( CString s );
|
||||||
int GetHashForFile( CString sPath );
|
int GetHashForFile( CString sPath );
|
||||||
int GetHashForDirectory( CString sDir ); // a hash value that remains the same as long as nothing in the directory has changed
|
int GetHashForDirectory( CString sDir ); // a hash value that remains the same as long as nothing in the directory has changed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user