mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-06 05:37:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user