diff --git a/Foundation/src/SHA1Engine.cpp b/Foundation/src/SHA1Engine.cpp index 7ea17df56e..5a2d7b578f 100644 --- a/Foundation/src/SHA1Engine.cpp +++ b/Foundation/src/SHA1Engine.cpp @@ -18,6 +18,7 @@ #include "Poco/SHA1Engine.h" +#include "Poco/ByteOrder.h" #include @@ -50,13 +51,12 @@ inline void SHA1Engine::byteReverse(UInt32* buffer, int byteCount) byteCount /= sizeof(UInt32); for(int count = 0; count < byteCount; count++) { - UInt32 value = (buffer[ count ] << 16) | (buffer[ count ] >> 16); - buffer[count] = ((value & 0xFF00FF00L) >> 8) | ((value & 0x00FF00FFL) << 8); + buffer[count] = Poco::ByteOrder::toBigEndian(buffer[ count ]); } #endif // POCO_ARCH_LITTLE_ENDIAN } - + void SHA1Engine::updateImpl(const void* buffer_, std::size_t count) { const BYTE* buffer = (const BYTE*) buffer_;