mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
13 lines
304 B
C++
13 lines
304 B
C++
#include "StrUtils.h"
|
|
#include <stdlib.h>
|
|
|
|
void CreateRandomString(char *pszDest, int nLength)
|
|
{
|
|
static const char c_szAlphaNum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
for (int i = 0; i < nLength; ++i)
|
|
pszDest[i] = c_szAlphaNum[rand() % (sizeof(c_szAlphaNum) - 1)];
|
|
|
|
pszDest[nLength] = '\0';
|
|
}
|