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

github.com/SoftEtherVPN/libhamcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Memory.c')
-rw-r--r--Memory.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Memory.c b/Memory.c
new file mode 100644
index 0000000..b7ef7fc
--- /dev/null
+++ b/Memory.c
@@ -0,0 +1,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;
+}