Add function for convert vectors to bytes