Add conversion function which converts to a byte vector