Array and Hash encoding