Renamed hex() to toHex()