From 06f87c973415f8344fcc56b5f13bc12e46984aa9 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 17 Nov 2023 01:47:24 -0500 Subject: [PATCH] fix missing cstring --- include/blt/std/uuid.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/blt/std/uuid.h b/include/blt/std/uuid.h index 3486f0c..0f9e29b 100755 --- a/include/blt/std/uuid.h +++ b/include/blt/std/uuid.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace blt::uuid { @@ -84,7 +85,7 @@ namespace blt::uuid std::stringstream ss; ss << std::hex; - const char dash[] = { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0 }; + const char dash[] = {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0}; for (int i = 0; i < len; ++i) { @@ -155,7 +156,7 @@ namespace blt::uuid static uuid_t genV4() { std::random_device rd; - std::seed_seq seed{ rd(), rd(), rd(), rd() }; + std::seed_seq seed{rd(), rd(), rd(), rd()}; std::mt19937_64 gen(seed); std::uniform_int_distribution dis(0, 15); std::uniform_int_distribution<> dis2(8, 11); @@ -163,24 +164,29 @@ namespace blt::uuid std::stringstream ss; int i; ss << std::hex; - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) + { ss << dis(gen); } ss << "-"; - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) + { ss << dis(gen); } ss << "-4"; - for (i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) + { ss << dis(gen); } ss << "-"; ss << dis2(gen); - for (i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) + { ss << dis(gen); } ss << "-"; - for (i = 0; i < 12; i++) { + for (i = 0; i < 12; i++) + { ss << dis(gen); }; @@ -188,7 +194,6 @@ namespace blt::uuid } - } #endif //BLT_UUID_H