diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 402a19b7b2..a4998e79c1 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -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 diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 8eaa1737ad..c3ed424355 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -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