Converts values to bytes