change bit masks to hex format