summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-01 00:49:02 +0800
committerruki <[email protected]>2025-10-01 00:49:02 +0800
commitdf4f8d13e506861cd6d9d8677cd270bfd0cd3a7b (patch)
tree41647ea4888b879b2e3d09e69961ea99999c9cf8 /core/src
parent9dc8bb99439f4d31e3563a5865764798c2094e8e (diff)
update clock seed
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/hash/rand128.c4
-rw-r--r--core/src/xmake/hash/rand32.c2
-rw-r--r--core/src/xmake/hash/rand64.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/core/src/xmake/hash/rand128.c b/core/src/xmake/hash/rand128.c
index 946d396fd..1e1f34fde 100644
--- a/core/src/xmake/hash/rand128.c
+++ b/core/src/xmake/hash/rand128.c
@@ -41,8 +41,8 @@ tb_int_t xm_hash_rand128(lua_State* lua)
static union { tb_byte_t b[16]; tb_uint64_t word[2]; } s_seed = {0};
if (!s_seed.word[0] && !s_seed.word[1])
{
- s_seed.word[0] = (tb_uint64_t)tb_mclock();
- s_seed.word[1] = (tb_uint64_t)tb_mclock();
+ s_seed.word[0] = (tb_uint64_t)tb_uclock();
+ s_seed.word[1] = (tb_uint64_t)tb_uclock();
}
s_seed.word[0] = xm_hash_xorshift128(s_seed.word);
s_seed.word[1] = xm_hash_xorshift128(s_seed.word);
diff --git a/core/src/xmake/hash/rand32.c b/core/src/xmake/hash/rand32.c
index b76b0ae15..66885a2cd 100644
--- a/core/src/xmake/hash/rand32.c
+++ b/core/src/xmake/hash/rand32.c
@@ -40,7 +40,7 @@ tb_int_t xm_hash_rand32(lua_State* lua)
static union { tb_byte_t b[4]; tb_uint32_t word; } s_seed = {0};
if (!s_seed.word)
- s_seed.word = (tb_uint32_t)tb_mclock();
+ s_seed.word = (tb_uint32_t)tb_uclock();
s_seed.word = xm_hash_xorshift32(s_seed.word);
tb_char_t s[64];
diff --git a/core/src/xmake/hash/rand64.c b/core/src/xmake/hash/rand64.c
index a42d0eedb..31732bc53 100644
--- a/core/src/xmake/hash/rand64.c
+++ b/core/src/xmake/hash/rand64.c
@@ -40,7 +40,7 @@ tb_int_t xm_hash_rand64(lua_State* lua)
static union { tb_byte_t b[8]; tb_uint64_t word; } s_seed = {0};
if (!s_seed.word)
- s_seed.word = (tb_uint64_t)tb_mclock();
+ s_seed.word = (tb_uint64_t)tb_uclock();
s_seed.word = xm_hash_xorshift64(s_seed.word);
tb_char_t s[256];