Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Memory.c - github.com/SoftEtherVPN/libhamcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b7ef7fca1957d625dcf33e9f961ff0cd0da7683a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Memory.h"

size_t CompressionBufferSize(const size_t original_size) { return original_size * 2 + 256; }

uint32_t Swap32(const uint32_t value)
{
	uint32_t swapped;
	((uint8_t *)&swapped)[0] = ((uint8_t *)&value)[3];
	((uint8_t *)&swapped)[1] = ((uint8_t *)&value)[2];
	((uint8_t *)&swapped)[2] = ((uint8_t *)&value)[1];
	((uint8_t *)&swapped)[3] = ((uint8_t *)&value)[0];
	return swapped;
}