endian conversion functions moved into separated file