#pragma once
#include "../jabyengine_defines.hpp"

namespace JabyEngine {
    // Taken from boost endian

    static constexpr uint8_t read_be(uint8_t x) {
        return x;
    }

    static constexpr uint16_t read_be(uint16_t x) {
        return (x << 8) | (x >> 8);
    }

    static constexpr uint32_t read_be(uint32_t x) {
        const uint32_t step16 = x << 16 | x >> 16;
        return ((step16 << 8) & 0xff00ff00) | ((step16 >> 8) & 0x00ff00ff);
    }
}