random ids

This commit is contained in:
2024-02-13 01:19:12 +01:00
parent 267f8dffc1
commit 98ab974515
3 changed files with 53 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
#pragma once
#include "./fragment_store_i.hpp"
#include "entt/entity/fwd.hpp"
#include <entt/core/fwd.hpp>
#include <entt/core/type_info.hpp>
@@ -14,6 +13,7 @@
#include <vector>
#include <array>
#include <cstdint>
#include <random>
enum class Encryption : uint8_t {
NONE = 0x00,
@@ -99,6 +99,7 @@ struct SerializerCallbacks {
struct FragmentStore : public FragmentStoreI {
entt::basic_registry<FragmentID> _reg;
std::minstd_rand _rng{std::random_device{}()};
std::array<uint8_t, 8> _session_uuid_namespace;
std::string _default_store_path;
@@ -116,6 +117,9 @@ struct FragmentStore : public FragmentStoreI {
// TODO: make the frags ref counted
std::vector<uint8_t> generateNewUID(std::array<uint8_t, 8>& uuid_namespace);
std::vector<uint8_t> generateNewUID(void);
// ========== new fragment ==========
// memory backed owned