Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
b
c
d
e
h
i
l
m
n
p
r
s
u
x
Typedefs
b
c
d
e
f
g
i
m
p
r
u
v
Enumerations
Enumerator
a
b
f
g
i
m
n
r
s
u
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
k
l
m
p
r
s
t
v
w
Enumerator
a
b
d
f
g
h
i
l
m
n
o
p
r
s
u
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
b
c
d
e
f
g
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
i
k
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Macros
_
d
f
i
m
n
p
s
t
u
shared
depthai-shared
src
utility
Checksum.cpp
Go to the documentation of this file.
1
#include "
depthai-shared/utility/Checksum.hpp
"
2
3
namespace
dai
{
4
namespace
utility {
5
6
std::uint32_t
checksum
(
const
void
*
buffer
, std::size_t
size
, uint32_t prevChecksum) {
7
uint32_t
checksum
= prevChecksum;
8
auto
p =
reinterpret_cast<
const
uint8_t*
>
(
buffer
);
9
10
for
(std::size_t i = 0; i <
size
; i++) {
11
checksum
= ((
checksum
<< 5) +
checksum
) + p[i];
/* hash * 33 + p[i] */
12
}
13
14
return
checksum
;
15
}
16
17
std::uint32_t
checksum
(
const
void
*
buffer
, std::size_t
size
) {
18
constexpr
static
auto
checksumInitialValue = 5381U;
19
return
checksum
(
buffer
,
size
, checksumInitialValue);
20
}
21
22
}
// namespace utility
23
}
// namespace dai
Checksum.hpp
dai::utility::checksum
std::uint32_t checksum(const void *buffer, std::size_t size, uint32_t prevChecksum)
Definition:
Checksum.cpp:6
nanorpc::core::type::buffer
std::vector< std::uint8_t > buffer
Definition:
type.h:28
DAI_SPAN_NAMESPACE_NAME::detail::size
constexpr auto size(const C &c) -> decltype(c.size())
Definition:
span.hpp:167
dai
Definition:
CameraExposureOffset.hpp:6
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:18