You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - uuid.cpp
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2022/05/23 (y/m/d)
|
|
|
|
|
* Mod Date - 2022/05/23 (y/m/d)
|
|
|
|
|
* Description - Generates 64 bit uuids
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "uuid.h"
|
|
|
|
|
#include <ctime>
|
|
|
|
|
|
|
|
|
|
namespace lunarium
|
|
|
|
|
{
|
|
|
|
|
std::mt19937_64 UUID::mt64(time(nullptr));
|
|
|
|
|
LUUID UUID::GetNewID()
|
|
|
|
|
{
|
|
|
|
|
// This is kind of hacky. Should probably try to remove the need for null ids.
|
|
|
|
|
// LUUID id = 0;
|
|
|
|
|
// while (0 == id)
|
|
|
|
|
// {
|
|
|
|
|
// id = mt64();
|
|
|
|
|
// }
|
|
|
|
|
// return id;
|
|
|
|
|
|
|
|
|
|
return mt64();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LUUID UUID::GetNullID()
|
|
|
|
|
// {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
}
|