diff options
| author | ruki <[email protected]> | 2019-11-26 00:47:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-11-25 23:40:49 +0800 |
| commit | 2101b278bb3f1d15395110b25b63a8536ecffb94 (patch) | |
| tree | 0b8166a2708793b181cea500091c214555de2603 /core/src | |
| parent | dee47ccf498d9ed84e58885257d8f84863922a1a (diff) | |
impl hash.uuid4
Diffstat (limited to 'core/src')
| m--------- | core/src/tbox/tbox | 0 | ||||
| -rw-r--r-- | core/src/xmake/hash/uuid4.c (renamed from core/src/xmake/hash/uuid.c) | 12 | ||||
| -rw-r--r-- | core/src/xmake/machine.c | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox -Subproject eb29b093abfeb7db2d7ae95892a055749df17af +Subproject 2e773b53e4aefb143e841a05aed675f5b8da60c diff --git a/core/src/xmake/hash/uuid.c b/core/src/xmake/hash/uuid4.c index 399f224bb..5f4ca6138 100644 --- a/core/src/xmake/hash/uuid.c +++ b/core/src/xmake/hash/uuid4.c @@ -15,14 +15,14 @@ * Copyright (C) 2015 - 2019, TBOOX Open Source Group. * * @author ruki - * @file uuid.c + * @file uuid4.c * */ /* ////////////////////////////////////////////////////////////////////////////////////// * trace */ -#define TB_TRACE_MODULE_NAME "uuid" +#define TB_TRACE_MODULE_NAME "uuid4" #define TB_TRACE_MODULE_DEBUG (0) /* ////////////////////////////////////////////////////////////////////////////////////// @@ -33,7 +33,7 @@ /* ////////////////////////////////////////////////////////////////////////////////////// * implementation */ -tb_int_t xm_hash_uuid(lua_State* lua) +tb_int_t xm_hash_uuid4(lua_State* lua) { // check tb_assert_and_check_return_val(lua, 0); @@ -41,10 +41,8 @@ tb_int_t xm_hash_uuid(lua_State* lua) // get the name tb_char_t const* name = luaL_optstring(lua, 1, tb_null); - // make uuid + // make uuid, use version 4 tb_char_t uuid[37]; - lua_pushstring(lua, tb_uuid_make_cstr(uuid, name)); - - // ok + lua_pushstring(lua, tb_uuid4_make_cstr(uuid, name)); return 1; } diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index faeadfe4f..dd606f0b6 100644 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -137,7 +137,7 @@ tb_int_t xm_path_translate(lua_State* lua); tb_int_t xm_path_is_absolute(lua_State* lua); // the hash functions -tb_int_t xm_hash_uuid(lua_State* lua); +tb_int_t xm_hash_uuid4(lua_State* lua); tb_int_t xm_hash_sha256(lua_State* lua); // the windows functions @@ -295,7 +295,7 @@ static luaL_Reg const g_path_functions[] = // the hash functions static luaL_Reg const g_hash_functions[] = { - { "uuid", xm_hash_uuid } + { "uuid4", xm_hash_uuid4 } , { "sha256", xm_hash_sha256 } , { tb_null, tb_null } }; |
