Base class for the Hash abstraction.
More...
#include <hash.hpp>
|
using | Impl = HashImpl< Context > |
|
|
static auto | init (auto ... args) |
| Hash initialization. More...
|
|
static auto | deinit (auto ... args) |
| Hash deinitialization. More...
|
|
static u8 | getCRC8 (const auto &data, u8 initValue=0x00, u8 polynomial=0x07, u8 xorOut=0x00) noexcept |
| Hardware accelerated CRC8 caluclation. More...
|
|
static u16 | getCRC16 (const auto &data, u16 initValue=0x0000, u16 polynomial=0x8005, u16 xorOut=0x0000) noexcept |
| Hardware accelerated CRC16 caluclation. More...
|
|
static u32 | getCRC32 (const auto &data, u32 initValue=0xFFFF 'FFFF, u32 polynomial=0x04C11DB7, u32 xorOut=0xFFFFFFFF) noexcept |
| Hardware accelerated CRC32 caluclation. More...
|
|
template<auto Context, template< addr_t > typename HashImpl>
struct bsp::drv::Hash< Context, HashImpl >
Base class for the Hash abstraction.
- Template Parameters
-
Context | Hash context |
HashImpl | Hash Implementation |
◆ Impl
template<auto Context, template< addr_t > typename HashImpl>
◆ Hash() [1/2]
template<auto Context, template< addr_t > typename HashImpl>
◆ Hash() [2/2]
template<auto Context, template< addr_t > typename HashImpl>
◆ deinit()
template<auto Context, template< addr_t > typename HashImpl>
static auto bsp::drv::Hash< Context, HashImpl >::deinit |
( |
auto ... |
args | ) |
|
|
inlinestatic |
Hash deinitialization.
- Parameters
-
args | Platform specific arguments |
- Returns
- Success
◆ getCRC16()
template<auto Context, template< addr_t > typename HashImpl>
static u16 bsp::drv::Hash< Context, HashImpl >::getCRC16 |
( |
const auto & |
data, |
|
|
u16 |
initValue = 0x0000 , |
|
|
u16 |
polynomial = 0x8005 , |
|
|
u16 |
xorOut = 0x0000 |
|
) |
| |
|
inlinestaticnoexcept |
Hardware accelerated CRC16 caluclation.
- Parameters
-
data | Data to calculate CRC of |
initValue | Start value |
polynomial | Used polynomial |
xorOut | Value to xor result value with |
- Returns
- CRC 16
- Note
- By default this function uses the CRC-16/ARC settings
◆ getCRC32()
template<auto Context, template< addr_t > typename HashImpl>
static u32 bsp::drv::Hash< Context, HashImpl >::getCRC32 |
( |
const auto & |
data, |
|
|
u32 |
initValue = 0xFFFF'FFFF , |
|
|
u32 |
polynomial = 0x04C11DB7 , |
|
|
u32 |
xorOut = 0xFFFFFFFF |
|
) |
| |
|
inlinestaticnoexcept |
Hardware accelerated CRC32 caluclation.
- Parameters
-
data | Data to calculate CRC of |
initValue | Start value |
polynomial | Used polynomial |
xorOut | Value to xor result value with |
- Returns
- CRC 32
- Note
- By default this function uses the CRC-32 (ethernet) settings
◆ getCRC8()
template<auto Context, template< addr_t > typename HashImpl>
static u8 bsp::drv::Hash< Context, HashImpl >::getCRC8 |
( |
const auto & |
data, |
|
|
u8 |
initValue = 0x00 , |
|
|
u8 |
polynomial = 0x07 , |
|
|
u8 |
xorOut = 0x00 |
|
) |
| |
|
inlinestaticnoexcept |
Hardware accelerated CRC8 caluclation.
- Parameters
-
data | Data to calculate CRC of |
initValue | Start value |
polynomial | Used polynomial |
xorOut | Value to xor result value with |
- Returns
- CRC 8
- Note
- By default this function uses the CRC-8 settings
◆ init()
template<auto Context, template< addr_t > typename HashImpl>
static auto bsp::drv::Hash< Context, HashImpl >::init |
( |
auto ... |
args | ) |
|
|
inlinestatic |
Hash initialization.
- Parameters
-
args | Platform specific arguments |
- Returns
- Success
◆ operator=()
template<auto Context, template< addr_t > typename HashImpl>
The documentation for this struct was generated from the following file: