Skip to content

Commit

Permalink
sstream --> hex index
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Feb 3, 2025
1 parent 0e09529 commit b3bebf2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/SharedMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include <memory>
#include <random>
#include <sstream>
#include <string>
#include <type_traits>

Expand Down Expand Up @@ -86,10 +85,9 @@ class SharedMemoryData
std::mt19937 gen(rd()); // mersenne twister, seeded
std::uniform_int_distribution<> distrib(0, 15); // hex range (0-15)

key.reserve(length);
for (int i = 0; i < length; i++) {
std::stringstream ss;
ss << std::hex << distrib(gen);
key += ss.str();
key += "0123456789ABCDEF"[distrib(gen)];
}

return key;
Expand Down

0 comments on commit b3bebf2

Please sign in to comment.