move getHexStringOfArrayBuffer to where its needed