|
NSUNI/NSLAR Library a250670
|
Provides functions and classes for handling binary data. More...
Classes | |
| class | nnl::utl::data::MD5Context |
| A utility class for calculating MD5 message digests. More... | |
Functions | |
| constexpr u32 | nnl::utl::data::FourCC (const char(&str)[5]) noexcept |
| Generates a numeric four character code from a given string. | |
| template<typename T> | |
| T | nnl::utl::data::SwapEndian (T src) noexcept |
| Swaps endianness of a value. | |
| template<typename E> | |
| constexpr std::underlying_type< E >::type | nnl::utl::data::as_int (E e) noexcept |
| Converts an enum value to its underlying integer type. | |
| template<class T, class U> | |
| constexpr T | nnl::utl::data::narrow_cast (U &&u) noexcept |
| Narrowing cast without bounds checking. | |
| template<class T, class U, typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr> | |
| constexpr T | nnl::utl::data::narrow (U u) |
| Safe narrowing cast with runtime bounds checking. | |
| u32 | nnl::utl::data::CRC32 (BufferView data, u32 polynomial=0xEDB88320) noexcept |
| Calculates a CRC32 checksum. | |
| u32 | nnl::utl::data::XXH32 (BufferView data, u32 seed=0xC0108888) |
| Calculates an XXH32 checksum. | |
| std::array< u8, 16 > | nnl::utl::data::MD5 (BufferView data) noexcept |
| Calculates an MD5 checksum. | |
| template<typename To, typename From> | |
| auto | nnl::utl::data::ReinterpretContainer (const std::vector< From > &container) |
| Reinterprets container data as a different type (via a bitwise copy) | |
| template<typename To, typename From> | |
| auto | nnl::utl::data::CastContainer (const std::vector< From > &container) |
| Casts container elements to a different type. | |
Provides functions and classes for handling binary data.
| class nnl::utl::data::MD5Context |
A utility class for calculating MD5 message digests.
This class provides a stateful interface for computing 128-bit hashes using the MD5 algorithm. It follows the "update-final" pattern, allowing datasets to be processed in chunks.
Public Member Functions | |
| void | Update (BufferView data) noexcept |
| Updates the hash state by processing a new chunk of data. | |
| std::array< u8, 16 > | Final () noexcept |
| Finalizes the hashing process and retrieves the result. | |
|
nodiscardnoexcept |
Finalizes the hashing process and retrieves the result.
|
noexcept |
Updates the hash state by processing a new chunk of data.
| data | The input data to be hashed. |
|
constexprnoexcept |
Converts an enum value to its underlying integer type.
| E | Enum type |
| e | Enum value |
| auto nnl::utl::data::CastContainer | ( | const std::vector< From > & | container | ) |
Casts container elements to a different type.
| To | Destination type |
| From | Source type |
| container | Source container |
|
noexcept |
Calculates a CRC32 checksum.
| data | Data to digest |
| polynomial | Custom polynomial |
|
constexprnoexcept |
Generates a numeric four character code from a given string.
Combines character values of the input string into a single unsigned integer.
| str | Input string. |
|
noexcept |
Calculates an MD5 checksum.
| data | Data to digest |
|
constexpr |
Safe narrowing cast with runtime bounds checking.
| T | Destination type |
| U | Source type |
| u | Value to cast |
| NarrowError | if narrowing would lose information |
|
constexprnoexcept |
Narrowing cast without bounds checking.
This is a semantic alias for static_cast. It signals intent that a loss of precision is expected and handled.
| T | Destination type |
| U | Source type |
| u | Value to cast |
| auto nnl::utl::data::ReinterpretContainer | ( | const std::vector< From > & | container | ) |
Reinterprets container data as a different type (via a bitwise copy)
| To | Destination type |
| From | Source type |
| container | Source container |
| RuntimeError | if the byte size of containers is not the same |
|
noexcept |
Swaps endianness of a value.
| T | Numeric type |
| src | Value to swap |
| u32 nnl::utl::data::XXH32 | ( | BufferView | data, |
| u32 | seed = 0xC0108888 ) |
Calculates an XXH32 checksum.
| data | Data to digest |
| seed | Custom seed |