From 1fae63de23320a1663b7c591e247ad81852ab6dc Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 22 Nov 2020 13:00:06 +0100 Subject: Support 16-bit short --- byteorder.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 byteorder.h (limited to 'byteorder.h') diff --git a/byteorder.h b/byteorder.h new file mode 100644 index 0000000..56555b7 --- /dev/null +++ b/byteorder.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +namespace endian { + + std::vector to_little(uint16_t value); + uint16_t from_little16(const std::vector& value); + + std::vector to_little(uint32_t value); + uint32_t from_little32(const std::vector& value); + + std::vector to_little(uint64_t value); + uint64_t from_little64(const std::vector& value); + +} -- cgit v1.2.3