Skip to content

Commit

Permalink
Improve convert to big-endian from little-endian (#1804) (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 authored and aleks-f committed Jul 17, 2017
1 parent f2bb057 commit 1e4ee01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Foundation/src/SHA1Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


#include "Poco/SHA1Engine.h"
#include "Poco/ByteOrder.h"
#include <cstring>


Expand Down Expand Up @@ -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_;
Expand Down

0 comments on commit 1e4ee01

Please sign in to comment.