use single code base for integer/big endian bin conversion