Reducing allocations when converting to hex for speed