code: function checksum(data) {
  	var result = data.split('').map(function (n) {
  		return +n;
  	}).reduce(function (sum, a, idx) {
  		return idx % 2 ? sum + a * 9 : sum + a * 3;
  	}, 0);
  	return result % 10;
  }
docs: Encoding documentation: