BAN: Remove endianness functions from Math

There is now a Endianness.h for these. The functions were super slow.
This commit is contained in:
Bananymous 2023-09-29 19:38:07 +03:00
parent 6304388100
commit 0b93fce923
1 changed files with 0 additions and 18 deletions

View File

@ -102,22 +102,4 @@ namespace BAN::Math
return result; return result;
} }
template<integral T>
inline constexpr T little_endian_to_host(const uint8_t* bytes)
{
T result = 0;
for (size_t i = 0; i < sizeof(T); i++)
result |= (T)bytes[i] << (i * 8);
return result;
}
template<integral T>
inline constexpr T big_endian_to_host(const uint8_t* bytes)
{
T result = 0;
for (size_t i = 0; i < sizeof(T); i++)
result |= (T)bytes[i] << (8 * (sizeof(T) - i - 1));
return result;
}
} }