mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 07:23:26 +00:00
added check
This commit is contained in:
@@ -123,6 +123,8 @@ namespace omath
|
|||||||
}
|
}
|
||||||
OMATH_FORCEINLINE constexpr void decrypt()
|
OMATH_FORCEINLINE constexpr void decrypt()
|
||||||
{
|
{
|
||||||
|
if (m_is_encrypted)
|
||||||
|
return;
|
||||||
std::span bytes{reinterpret_cast<std::uint8_t*>(&m_data), sizeof(m_data)};
|
std::span bytes{reinterpret_cast<std::uint8_t*>(&m_data), sizeof(m_data)};
|
||||||
|
|
||||||
for (size_t i = 0; i < bytes.size(); ++i)
|
for (size_t i = 0; i < bytes.size(); ++i)
|
||||||
@@ -131,6 +133,8 @@ namespace omath
|
|||||||
}
|
}
|
||||||
OMATH_FORCEINLINE constexpr void encrypt()
|
OMATH_FORCEINLINE constexpr void encrypt()
|
||||||
{
|
{
|
||||||
|
if (!m_is_encrypted)
|
||||||
|
return;
|
||||||
std::span bytes{reinterpret_cast<std::uint8_t*>(&m_data), sizeof(m_data)};
|
std::span bytes{reinterpret_cast<std::uint8_t*>(&m_data), sizeof(m_data)};
|
||||||
|
|
||||||
for (size_t i = 0; i < bytes.size(); ++i)
|
for (size_t i = 0; i < bytes.size(); ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user