libxcks  0.1.0.1
types.hpp
Go to the documentation of this file.
1 /*
2  * libxcks
3  * Copyright (C) 2022 Julien Couot
4  *
5  * This program is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 #ifndef INC_TYPES_HPP_388E8209_96DF_4791_896C_A1EBCC999B64
26 #define INC_TYPES_HPP_388E8209_96DF_4791_896C_A1EBCC999B64
27 
28 //---------------------------------------------------------------------------
29 #include <string>
30 #include <vector>
31 #include <set>
32 #include <filesystem>
33 //---------------------------------------------------------------------------
34 
35 
36 namespace libxcks
37 {
39 using StringSet = std::set<std::string>;
40 //---------------------------------------------------------------------------
41 
42 
44 using ArrayString = std::vector<std::string>;
45 //---------------------------------------------------------------------------
46 
47 
49 using ArrayPath = std::vector<std::filesystem::path>;
50 //---------------------------------------------------------------------------
51 
52 
54 enum class Version : int
55 {
56  V1_0_0,
58  Last_Valid = V1_0_0,
59 };
60 //---------------------------------------------------------------------------
61 
62 
64 enum class ChecksumAlgoId : int
65 {
66  Invalid = -999,
67  CRC32 = 0,
68  First = CRC32,
69  CRC64,
70  MD2,
71  MD4,
72  MD5,
73  RIPEMD_160,
74  SHA1,
75  SHA2_224,
76  SHA2_256,
77  SHA2_384,
78  SHA2_512,
79  SHA3_224,
80  SHA3_256,
81  SHA3_384,
82  SHA3_512,
83  BLAKE3,
84  SM3,
85  Tiger,
86  Whirlpool,
87  Last = Whirlpool
88 };
89 //---------------------------------------------------------------------------
90 
92 using ArrayChecksumAlgoId = std::vector<ChecksumAlgoId>;
93 //---------------------------------------------------------------------------
94 
95 
96 } // namespace libxcks
97 //---------------------------------------------------------------------------
98 
99 #endif // INC_TYPES_HPP_388E8209_96DF_4791_896C_A1EBCC999B64
Computes the BLAKE3 hash from a byte stream.
Definition: blake3.hpp:57
Computes the CRC-32 from a byte stream.
Definition: crc32.hpp:53
Computes the CRC-64 (ECMA 182 standard) from a byte stream.
Definition: crc64.hpp:52
Computes the MD2 hash from a byte stream.
Definition: md2.hpp:57
Computes the MD4 hash from a byte stream.
Definition: md4.hpp:57
Computes the MD5 hash from a byte stream.
Definition: md5.hpp:56
Computes the SHA1 (or SHA160) hash from a byte stream.
Definition: sha1.hpp:57
Computes the SHA3-224 hash from a byte stream.
Definition: keccak.hpp:135
Computes the SHA3-256 hash from a byte stream.
Definition: keccak.hpp:264
Computes the SHA3-384 hash from a byte stream.
Definition: keccak.hpp:393
Computes the SHA3-512 hash from a byte stream.
Definition: keccak.hpp:522
Computes the SM3 hash from a byte stream.
Definition: sm3.hpp:57
Computes the Tiger hash from a byte stream.
Definition: tiger.hpp:57
Computes the Whirlpool hash from a byte stream.
Definition: whirlpool.hpp:58
std::vector< ChecksumAlgoId > ArrayChecksumAlgoId
Array of ids of algorithms of checksums.
Definition: types.hpp:92
std::vector< std::filesystem::path > ArrayPath
Array of paths.
Definition: types.hpp:49
ChecksumAlgoId
Ids of algorithms of checksums.
Definition: types.hpp:65
@ Invalid
Invalid algorithm id.
@ SHA2_384
Secure Hash Algorithm 2 (384 bits, truncated version of SHA-512).
@ SHA2_256
Secure Hash Algorithm 2 (256 bits).
@ First
First algorithm (for loops).
@ Last
Last algorithm (for loops).
@ SHA2_224
Secure Hash Algorithm 2 (224 bits, truncated version of SHA-256).
@ RIPEMD_160
RIPE Message Digest (160 bits).
@ SHA2_512
Secure Hash Algorithm 2 (512 bits).
std::vector< std::string > ArrayString
Array of strings.
Definition: types.hpp:44
Version
Known versions of XCKS file.
Definition: types.hpp:55
@ Last_Valid
Last valid known version.
@ V1_0_0
Version 1.0.0.
@ First_Valid
First valid known version.
std::set< std::string > StringSet
Set of strings.
Definition: types.hpp:39