chunk_to_hex() adaptations