Updated the functions to swap endianness to support 32-bits values