Files
watrbx-game-engine/App/util/rbxrandom.cpp
T
2025-09-18 17:55:52 -04:00

20 lines
414 B
C++

#include "stdafx.h"
#include "util/rbxrandom.h"
namespace RBX {
unsigned int randomSeed()
{
std::string guid;
RBX::Guid::generateStandardGUID(guid);
unsigned int seed = 0;
for (unsigned int i=0; i < guid.size() - 4; i += 4)
{
std::string section = guid.substr(i, 4);
unsigned int seedSection;
strncpy((char*) &seedSection, section.c_str(), 4);
seed ^= seedSection;
}
return seed;
}
}