Lolly
1.4.28
Loading...
Searching...
No Matches
lolly
hash
uuid.cpp
Go to the documentation of this file.
1
2
/******************************************************************************
3
* MODULE : uuid.cpp
4
* DESCRIPTION: UUID generation
5
* COPYRIGHT : (C) 2023 Darcy Shen
6
*******************************************************************************
7
* This software falls under the GNU general public license version 3 or later.
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10
******************************************************************************/
11
12
#include "
uuid.hpp
"
13
#include "
basic.hpp
"
14
15
#include <tbox/tbox.h>
16
17
namespace
lolly
{
18
namespace
hash
{
19
string
20
uuid_make
() {
21
tb_char_t
uuid
[37];
22
const
tb_char_t
*
ret
=
tb_uuid4_make_cstr
(
uuid
,
tb_null
);
23
if
(
ret
==
NULL
) {
24
TM_FAILED
(
"Failed to generate UUID"
);
25
}
26
return
string
(
ret
);
27
}
28
}
// namespace hash
29
}
// namespace lolly
hash
int hash(pointer ptr)
Computes a hash value for a pointer.
Definition
basic.cpp:17
basic.hpp
TM_FAILED
#define TM_FAILED(msg)
Macro used to throw an exception with a specified error message.
Definition
basic.hpp:93
list
The list class represents a linked list.
Definition
list.hpp:48
string
Definition
string.hpp:40
lolly::hash::uuid_make
string uuid_make()
Definition
uuid.cpp:20
lolly
Definition
lolly_tree_bench.cpp:13
uuid.hpp
Generated by
1.10.0