• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef NETMGR_EXT_UUID_H
17 #define NETMGR_EXT_UUID_H
18 
19 #include <string>
20 #include <array>
21 
22 namespace OHOS {
23 namespace NetManagerStandard {
24 class UUID {
25 public:
26     //128 bits uuid length
27     const static int UUID128_BYTES_LEN = 16;
28 
UUID()29     UUID(){};
30 
~UUID()31     ~UUID(){};
32 
33     /**
34      * @brief A constructor used to create an <b>UUID</b> instance. Constructor a new random UUID.
35      *
36      * @return Returns a random UUID.
37      */
38     static UUID RandomUUID();
39 
40     /**
41      * @brief Convert UUID to string.
42      *
43      * @return Returns a String object representing this UUID.
44      */
45     std::string ToString() const;
46 
47 private:
48     std::array<uint8_t, UUID128_BYTES_LEN> uuid_ = {0x00};
49 };
50 
51 using ParcelUuid = UUID;
52 } // namespace NetManagerStandard
53 } // namespace OHOS
54 
55 #endif  //NETMGR_EXT_UUID_H