summaryrefslogtreecommitdiffstats
path: root/uint16_pack.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2010-07-09 12:32:17 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2010-07-09 12:32:17 +0200
commit6c027b4de25a529908be895e7ff19236f4002a57 (patch)
treef70d3a400bbb9ba8a83e9d4ffcaa4b6e367fc8bb /uint16_pack.c
downloadcrypto-6c027b4de25a529908be895e7ff19236f4002a57.zip
crypto-6c027b4de25a529908be895e7ff19236f4002a57.tar.gz
initial commit, resurrect one of my realy old projects
Diffstat (limited to 'uint16_pack.c')
-rw-r--r--uint16_pack.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/uint16_pack.c b/uint16_pack.c
new file mode 100644
index 0000000..285cecf
--- /dev/null
+++ b/uint16_pack.c
@@ -0,0 +1,13 @@
+#include "uint16.h"
+
+__inline void u16_pack(char s[2],u16 u)
+{
+ s[0] = u & 255;
+ s[1] = u >> 8;
+}
+
+__inline void u16_pack_big(char s[2],u16 u)
+{
+ s[1] = u & 255;
+ s[0] = u >> 8;
+}