mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 21:20:49 +00:00
Add missing file
This commit is contained in:
parent
093108bf81
commit
0d65a900b4
19
src/Core/UUID.cpp
Normal file
19
src/Core/UUID.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include <Core/UUID.h>
|
||||||
|
#include <Common/thread_local_rng.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace DB
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace UUIDHelpers
|
||||||
|
{
|
||||||
|
UUID generateV4()
|
||||||
|
{
|
||||||
|
UInt128 res{thread_local_rng(), thread_local_rng()};
|
||||||
|
res.items[0] = (res.items[0] & 0xffffffffffff0fffull) | 0x0000000000004000ull;
|
||||||
|
res.items[1] = (res.items[1] & 0x3fffffffffffffffull) | 0x8000000000000000ull;
|
||||||
|
return UUID{res};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user