diff options
Diffstat (limited to 'src/crypto/common.h')
-rw-r--r-- | src/crypto/common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/crypto/common.h b/src/crypto/common.h index 5b4932c992..c1acf8b22e 100644 --- a/src/crypto/common.h +++ b/src/crypto/common.h @@ -53,6 +53,13 @@ void static inline WriteLE64(unsigned char* ptr, uint64_t x) memcpy(ptr, (char*)&v, 8); } +uint16_t static inline ReadBE16(const unsigned char* ptr) +{ + uint16_t x; + memcpy((char*)&x, ptr, 2); + return be16toh(x); +} + uint32_t static inline ReadBE32(const unsigned char* ptr) { uint32_t x; |