Bitcoin Core
31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
test
util
str.cpp
Go to the documentation of this file.
1
// Copyright (c) 2019-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
test/util/str.h
>
6
7
#include <cstdint>
8
#include <string>
9
10
bool
CaseInsensitiveEqual
(
const
std::string&
s1
,
const
std::string&
s2
)
11
{
12
if
(
s1
.size() !=
s2
.size())
return
false
;
13
for
(
size_t
i = 0; i <
s1
.size(); ++i) {
14
char
c1
=
s1
[i];
15
if
(
c1
>=
'A'
&&
c1
<=
'Z'
)
c1
-= (
'A'
-
'a'
);
16
char
c2
=
s2
[i];
17
if
(
c2
>=
'A'
&&
c2
<=
'Z'
)
c2
-= (
'A'
-
'a'
);
18
if
(
c1
!=
c2
)
return
false
;
19
}
20
return
true
;
21
}
CaseInsensitiveEqual
bool CaseInsensitiveEqual(const std::string &s1, const std::string &s2)
Definition
str.cpp:10
str.h
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:73
Generated on Thu Apr 16 2026 09:42:38 for Bitcoin Core by
1.10.0