From 4b4c96d3cb787857afddbb96493878427a60f181 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Mon, 1 Mar 2021 12:48:54 +0800 Subject: [PATCH] =?UTF-8?q?ft:=E5=87=BD=E6=95=B0=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/uuid/utUuid.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/uuid/utUuid.erl b/src/uuid/utUuid.erl index 742978c..1c5239d 100644 --- a/src/uuid/utUuid.erl +++ b/src/uuid/utUuid.erl @@ -4,6 +4,7 @@ randStr/1 %% 随机指定长度的字符串 , uuid/0 %% 获取唯一UUID , uuidHex/0 %% 获取hex格式的唯一UUID + , uuidHexBin/0 ]). -spec randStr(integer()) -> string(). @@ -28,3 +29,7 @@ uuid() -> -spec uuidHex() -> binary(). uuidHex() -> utMd5:getMd5Hex(term_to_binary({erlang:system_time(nanosecond), rand:uniform(134217727), make_ref()})). + +-spec uuidHexBin() -> binary(). +uuidHexBin() -> + utMd5:getMd5HexBin(term_to_binary({erlang:system_time(nanosecond), rand:uniform(134217727), make_ref()})). \ No newline at end of file