diff options
Diffstat (limited to 'byteorder.h')
-rw-r--r-- | byteorder.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 <cstdint> +#include <vector> + +namespace endian { + + std::vector<uint8_t> to_little(uint16_t value); + uint16_t from_little16(const std::vector<uint8_t>& value); + + std::vector<uint8_t> to_little(uint32_t value); + uint32_t from_little32(const std::vector<uint8_t>& value); + + std::vector<uint8_t> to_little(uint64_t value); + uint64_t from_little64(const std::vector<uint8_t>& value); + +} |