mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
update sdl2 to release https://github.com/spurious/SDL-mirror/tree/release-2.0.14
This commit is contained in:
parent
52ecd8bb0f
commit
77fc164e96
675 changed files with 192770 additions and 60506 deletions
28
Engine/lib/sdl/visualtest/src/mischelper.c
Normal file
28
Engine/lib/sdl/visualtest/src/mischelper.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* \file mischelper.c
|
||||
*
|
||||
* Source file with miscellaneous helper functions.
|
||||
*/
|
||||
|
||||
#include <SDL_test.h>
|
||||
|
||||
void
|
||||
SDLVisualTest_HashString(char* str, char hash[33])
|
||||
{
|
||||
SDLTest_Md5Context md5c;
|
||||
int i;
|
||||
|
||||
if(!str)
|
||||
{
|
||||
SDLTest_LogError("str argument cannot be NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
SDLTest_Md5Init(&md5c);
|
||||
SDLTest_Md5Update(&md5c, (unsigned char*)str, SDL_strlen(str));
|
||||
SDLTest_Md5Final(&md5c);
|
||||
|
||||
/* convert the md5 hash to an array of hexadecimal digits */
|
||||
for(i = 0; i < 16; i++)
|
||||
SDL_snprintf(hash + 2 * i, 33 - 2 * i, "%02x", (int)md5c.digest[i]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue