]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/util.c
Fixed some compile warnings in client, minor tidy up with some dbprintf statements
[proxmark3-svn] / armsrc / util.c
index 3cad25f438928d4ffc464b8b7e29c09777eda665..e6332a7b57615224a547792f6082e694aed6046e 100644 (file)
@@ -64,6 +64,24 @@ char* strncat(char *dest, const char *src, unsigned int n)
        return dest;\r
 }\r
 \r
+void num_to_bytes(uint64_t n, size_t len, byte_t* dest)\r
+{\r
+       while (len--) {\r
+               dest[len] = (byte_t) n;\r
+               n >>= 8;\r
+       }\r
+}\r
+\r
+uint64_t bytes_to_num(byte_t* src, size_t len)\r
+{\r
+       uint64_t num = 0;\r
+       while (len--)\r
+       {\r
+               num = (num << 8) | (*src);\r
+               src++;\r
+       }\r
+       return num;\r
+}\r
 \r
 void LEDsoff()\r
 {\r
Impressum, Datenschutz