Move endianness helper functions from hash.c over to endianness.h