refactor code and less use of _rand64

This commit is contained in:
BONNAURE Olivier 2024-04-12 15:42:30 +02:00
parent 99da35ab47
commit fab02d9e5f

View file

@ -833,8 +833,8 @@ int LuaUuidV4(lua_State *L) {
char v[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
char uuid_str[37] = {0};
uint64_t r = 0;
for (int i = 0, j = 16; i < 36; ++i, ++j) {
uint64_t r = _rand();
for (int i = 0, j = 0; i < 36; ++i, ++j) {
if (j == 16) {
r = _rand64();