function encode(data) {
  $.checkArgument(data instanceof Array, 'Must be Array');
  var base32 = '';
  for (var i=0; i<data.length; i++) {
    var value = data[i];
    $.checkArgument(0 <= value && value < 32, 'value ' + value);
    base32 += CHARSET[value];
  }
  return base32;
}
Encodes the given array of 5-bit integers as a base32-encoded string.

@param {Array} data Array of integers between 0 and 31 inclusive.