diff options
| author | ruki <[email protected]> | 2025-09-30 00:53:37 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-30 00:53:37 +0800 |
| commit | d673b3732b66ddae22a5c2b3c613af5447d23dca (patch) | |
| tree | 0a1e873623516ca5eb5c4cec4ed762eb193c7b6a /core/src | |
| parent | aced9c7ece3127676e9cb25d2161ff08e5560149 (diff) | |
improve hash tests
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/hash/md5.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/src/xmake/hash/md5.c b/core/src/xmake/hash/md5.c index 1ca594941..0f6a9f598 100644 --- a/core/src/xmake/hash/md5.c +++ b/core/src/xmake/hash/md5.c @@ -108,9 +108,8 @@ tb_int_t xm_hash_md5(lua_State* lua) tb_md5_exit(&md5, buffer, sizeof(buffer)); // make md5 string - tb_size_t i = 0; - tb_char_t s[256] = {0}; - for (i = 0; i < 16; ++i) tb_snprintf(s + (i << 1), 3, "%02x", buffer[i]); + tb_char_t s[256]; + xm_hash_make_cstr(s, buffer, 16); // save result lua_pushstring(lua, s); |
