Stroika Library
3.0d16
Help-Home
Loading...
Searching...
No Matches
CRC32.h
Go to the documentation of this file.
1
/*
2
* Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3
*/
4
#ifndef _Stroika_Foundation_Cryptography_Digest_CRC32_h_
5
#define _Stroika_Foundation_Cryptography_Digest_CRC32_h_ 1
6
7
#include "Stroika/Foundation/StroikaPreComp.h"
8
9
#include <cstdint>
10
11
#include "Stroika/Foundation/Cryptography/Digest/Algorithm/Algorithm.h"
12
13
/**
14
* \file
15
*
16
* \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
17
*
18
* @see http://en.wikipedia.org/wiki/Cyclic_redundancy_check
19
* @see http://www.riccibitti.com/crcguide.htm
20
*
21
*
22
*/
23
24
namespace
Stroika::Foundation::Cryptography::Digest::Algorithm {
25
26
/**
27
* Algorithm 'type tag' indicating this particular algorithm.
28
*/
29
struct
CRC32
{};
30
31
/**
32
* Traits for the CRC32 algorithm.
33
*/
34
template
<>
35
struct
DigesterDefaultTraitsForAlgorithm
<
CRC32
> {
36
using
ReturnType = uint32_t;
37
};
38
39
/**
40
* \brief Windowing digester (code to do the digest algorithm) for the CRC32 algorithm.
41
*/
42
template
<>
43
class
DigesterAlgorithm
<
CRC32
> :
public
IDigestAlgorithm
<DigesterDefaultTraitsForAlgorithm<CRC32>::ReturnType> {
44
public
:
45
using
ReturnType =
DigesterDefaultTraitsForAlgorithm<CRC32>::ReturnType
;
46
47
public
:
48
DigesterAlgorithm
() =
default
;
49
DigesterAlgorithm
(
const
DigesterAlgorithm
& src) =
default
;
50
51
public
:
52
nonvirtual
DigesterAlgorithm
& operator= (
const
DigesterAlgorithm
& rhs) =
default
;
53
54
public
:
55
virtual
void
Write (
const
byte
* start,
const
byte
* end)
override
;
56
57
public
:
58
virtual
ReturnType Complete ()
override
;
59
60
private
:
61
uint32_t fData_{0xFFFFFFFF};
62
#if qStroika_Foundation_Debug_AssertionsChecked
63
bool
fCompleted_{
false
};
64
#endif
65
};
66
67
}
68
69
/*
70
********************************************************************************
71
***************************** Implementation Details ***************************
72
********************************************************************************
73
*/
74
#include "CRC32.inl"
75
76
#endif
/*_Stroika_Foundation_Cryptography_Digest_CRC32_h_*/
Stroika::Foundation::Cryptography::Digest::Algorithm::DigesterAlgorithm
DigesterAlgorithm is specialized for each algorithm; generally don't use this directly,...
Definition
Algorithm.h:55
Stroika::Foundation::Cryptography::Digest::Algorithm::IDigestAlgorithm
Definition
Algorithm.h:44
Stroika::Foundation::Cryptography::Digest::Algorithm::CRC32
Definition
CRC32.h:29
Stroika::Foundation::Cryptography::Digest::Algorithm::DigesterDefaultTraitsForAlgorithm
Definition
Algorithm.h:27
Library
Sources
Stroika
Foundation
Cryptography
Digest
Algorithm
CRC32.h
Generated by
1.9.8