KiCad PCB EDA Suite
Loading...
Searching...
No Matches
hash_128.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright (C) 2024 Alex Shvartzkop <
[email protected]
>
5
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef HASH_128_H_
22
#define HASH_128_H_
23
24
#include <cstdint>
25
#include <iomanip>
26
#include <sstream>
27
31
struct
HASH_128
32
{
33
void
Clear
()
34
{
35
memset(
Value64
, 0,
sizeof
(
Value64
) );
//
36
}
37
38
bool
operator==
(
const
HASH_128
& aOther )
const
39
{
40
return
memcmp(
Value64
, aOther.
Value64
,
sizeof
(
Value64
) ) == 0;
41
}
42
43
std::string
ToString
()
const
44
{
45
std::stringstream ss;
46
ss << std::hex << std::uppercase << std::setfill(
'0'
)
47
<< std::setw( 16 ) <<
Value64
[0]
48
<< std::setw( 16 ) <<
Value64
[1];
49
return
ss.str();
50
}
51
52
public
:
53
union
54
{
55
uint8_t
Value8
[16]{};
// Zero-initialized
56
uint32_t
Value32
[4];
57
uint64_t
Value64
[2];
58
};
59
};
60
61
#endif
// HASH_128_H_
HASH_128
A storage class for 128-bit hash value.
Definition
hash_128.h:32
HASH_128::Clear
void Clear()
Definition
hash_128.h:33
HASH_128::Value32
uint32_t Value32[4]
Definition
hash_128.h:56
HASH_128::operator==
bool operator==(const HASH_128 &aOther) const
Definition
hash_128.h:38
HASH_128::Value8
uint8_t Value8[16]
Definition
hash_128.h:55
HASH_128::ToString
std::string ToString() const
Definition
hash_128.h:43
HASH_128::Value64
uint64_t Value64[2]
Definition
hash_128.h:57
src
libs
kimath
include
hash_128.h
Generated on Fri Jun 26 2026 00:05:37 for KiCad PCB EDA Suite by
1.13.2