CRC32 for Torque
by Daniel Neilsen · 02/01/2002 (9:22 pm) · 2 comments
This is really quite simple.
Just add this function into consoleFunctions.cc
It allows you to use the command line
%hash = getStringCRC("bla");
The hash that is returned is compatible with php CRC32 so will be very handy when integrating into your auth/web servers.
Just add this function into consoleFunctions.cc
ConsoleFunction(getStringCRC, S32, 2, 2, "getStringCRC(string)")
{
argc;
U32 crcVal;
crcVal = calculateCRC (argv[1], dStrlen(argv[1]), -1);
crcVal = (crcVal*-1)-1;
return(S32(crcVal));
}It allows you to use the command line
%hash = getStringCRC("bla");
The hash that is returned is compatible with php CRC32 so will be very handy when integrating into your auth/web servers.
About the author

Torque Owner Ryan J. Parker