diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/uuid.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/uuid.cc b/source/blender/blenlib/intern/uuid.cc index 0c381e5dcd2..247928893f3 100644 --- a/source/blender/blenlib/intern/uuid.cc +++ b/source/blender/blenlib/intern/uuid.cc @@ -40,7 +40,10 @@ UUID BLI_uuid_generate_random() struct timespec ts; timespec_get(&ts, TIME_UTC); - rng.seed(ts.tv_nsec); + /* XOR the nanosecond and second fields, just in case the clock only has seconds resolution. */ + uint64_t seed = ts.tv_nsec; + seed ^= ts.tv_sec; + rng.seed(seed); return rng; }(); |