PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
|
A hashing struct used for sha256 hashing. More...
#include <sha256.hpp>
Public Member Functions | |
std::string | operator() (std::string input) const |
Calculate the sha256 hash for the input string. More... | |
Static Private Member Functions | |
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> | |
static void | unpack (const T x, unsigned char *str) |
Unpack the bits of x into the str . More... | |
static void | pack32 (const unsigned char *str, std::uint32_t &x) |
Pack four byte of the str into the 32-bit unsigned integer x . More... | |
static std::uint32_t | rotr32 (std::uint32_t value, unsigned int count) |
Rotate the bits in value @ count times to the right. More... | |
Static Private Attributes | |
static constexpr std::uint32_t | DIGEST_SIZE = 256 / 8 |
Number of bytes in the resulting digest. | |
static constexpr std::uint32_t | CHUNK_SIZE = 512 / 8 |
NUmber of bytes processed in one round (chunk). | |
static constexpr std::array< std::uint32_t, 64 > | k_ |
Array of the sha256 round constants. More... | |
A hashing struct used for sha256 hashing.
std::string plssvm::detail::sha256::operator() | ( | std::string | input | ) | const |
|
inlinestaticprivate |
Unpack the bits of x
into the str
.
T | the unsigned type and, therefore, number of bits, to unpack |
[in] | x | the integer representing the bits to unpack |
[out] | str | the string to unpack the bits to |
|
staticprivate |
Pack four byte of the str
into the 32-bit unsigned integer x
.
[in] | str | the string to pack |
[out] | x | the 32-bit unsigned integer to pack the bytes to |
|
staticprivate |
Rotate the bits in value
@ count times to the right.
Based on: https://en.wikipedia.org/wiki/Circular_shift
[in] | value | the 32-bit integer to rotate |
[in] | count | the number of bits to rotate |
[[nodiscard]]
)
|
staticconstexprprivate |
Array of the sha256 round constants.
First 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311.