From 49bf53ccd8ee576fe7b5ba78df56b2cc313df181 Mon Sep 17 00:00:00 2001 From: Dmitry Gerasimov <dmitriy.gerasimov@demlabs.net> Date: Tue, 30 Aug 2022 19:20:07 +0700 Subject: [PATCH] [+] GUUID --- dap-sdk/crypto/include/dap_guiid.h | 30 ++++++++++++++++++++++++++++++ dap-sdk/crypto/include/dap_uuid.h | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 dap-sdk/crypto/include/dap_guiid.h diff --git a/dap-sdk/crypto/include/dap_guiid.h b/dap-sdk/crypto/include/dap_guiid.h new file mode 100644 index 0000000000..8e468169f8 --- /dev/null +++ b/dap-sdk/crypto/include/dap_guiid.h @@ -0,0 +1,30 @@ +/* + * Authors: + * Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net> + * DeM Labs Ltd. https://demlabs.net + * Copyright (c) 2021 + * All rights reserved. + + This file is part of DAP SDK the open source project + + DAP SDK is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DAP SDK is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with any DAP SDK based project. If not, see <http://www.gnu.org/licenses/>. +*/ +#pragma once +#include "dap_uuid.h" + +typedef uint128_t dap_guuid_t; +static inline dap_guuid_t dap_guuid_new() +{ + return (dap_guuid_t) dap_uuid_generate_uint128(); +} diff --git a/dap-sdk/crypto/include/dap_uuid.h b/dap-sdk/crypto/include/dap_uuid.h index 6aa5e7e2bf..5e932f6d7f 100644 --- a/dap-sdk/crypto/include/dap_uuid.h +++ b/dap-sdk/crypto/include/dap_uuid.h @@ -24,7 +24,7 @@ #pragma once #include "dap_math_ops.h" -uint128_t dap_uuid_generate_uint128(); // Produce uint128 unique id -uint64_t dap_uuid_generate_uint64(); // Produce uint64 unique id +uint128_t dap_uuid_generate_uint128(); // Produce uint128 global unique id +uint64_t dap_uuid_generate_uint64(); // Produce uint64 global unique id // Produces unique nonce void dap_uuid_generate_nonce(void *a_nonce, size_t a_nonce_size); -- GitLab