Convert to hash that doesn't take more bytes than actual data