text: // Generated by CoffeeScript 1.6.3
  var C32,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  
  C32 = (function() {
    C32.ENCODE_MAP = {
      "o": "0",
      "O": "0",
      "0": "0",
      "i": "1",
      "I": "1",
      "l": "1",
      "1": "1",
      "2": "2",
      "3": "3",
      "4": "4",
      "5": "5",
      "6": "6",
      "7": "7",
      "8": "8",
      "9": "9",
      "a": "A",
      "A": "A",
      "B": "B",
      "c": "C",
      "C": "C",
      "d": "D",
      "D": "D",
      "e": "E",
      "E": "E",
      "f": "F",
      "F": "F",
      "g": "G",
      "G": "G",
      "h": "H",
      "H": "H",
      "j": "J",
      "J": "J",
      "k": "K",
      "K": "K",
      "m": "M",
      "M": "M",
      "n": "N",
      "N": "N",
      "p": "P",
      "P": "P",
      "q": "Q",
      "Q": "Q",
      "r": "R",
      "R": "R",
      "s": "S",
      "S": "S",
      "t": "T",
      "T": "T",
      "v": "V",
      "V": "V",
      "w": "W",
      "W": "W",
      "x": "X",
      "X": "X",
      "y": "Y",
      "Y": "Y",
      "z": "Z",
      "Z": "Z"
    };
  
    C32.POOL = "0123456789ABCDEFGHJKMNPQRSTVWXYZ".split("");
  
    C32.POOL_MAP = {
      "0": 0,
      "1": 1,
      "2": 2,
      "3": 3,
      "4": 4,
      "5": 5,
      "6": 6,
      "7": 7,
      "8": 8,
      "9": 9,
      "A": 10,
      "B": 11,
      "C": 12,
      "D": 13,
      "E": 14,
      "F": 15,
      "G": 16,
      "H": 17,
      "J": 18,
      "K": 19,
      "M": 20,
      "N": 21,
      "P": 22,
      "Q": 23,
      "R": 24,
      "S": 25,
      "T": 26,
      "V": 27,
      "W": 28,
      "X": 29,
      "Y": 30,
      "Z": 31
    };
  
    C32.CHECKSUM_POOL = "0123456789ABCDEFGHJKMNPQRSTVWZYZ*~$=U".split("");
  
    function C32() {
      this.getRandom = __bind(this.getRandom, this);
      this.isValid = __bind(this.isValid, this);
      this.calcChecksum = __bind(this.calcChecksum, this);
      this.addChecksum = __bind(this.addChecksum, this);
      this.toTen = __bind(this.toTen, this);
      this.parseInt = __bind(this.parseInt, this);
      this.value = "0";
    }
  
    C32.prototype.parseInt = function(unclean) {
      var c;
      if (unclean == null) {
        unclean = "";
      }
      return this.value = ((function() {
        var _i, _len, _results;
        _results = [];
        for (_i = 0, _len = unclean.length; _i < _len; _i++) {
          c = unclean[_i];
          _results.push(C32.ENCODE_MAP[c]);
        }
        return _results;
      })()).join("");
    };
  
    C32.prototype.toTen = function(value) {
      var i, n;
      if (value == null) {
        value = this.value;
      }
      return _((function() {
        var _i, _len, _results;
        _results = [];
        for (i = _i = 0, _len = value.length; _i < _len; i = ++_i) {
          n = value[i];
          _results.push(C32.POOL_MAP[n] * Math.pow(32, value.length - (i + 1)));
        }
        return _results;
      })()).reduce(function(a, b) {
        return a + b;
      });
    };
  
    C32.prototype.addChecksum = function() {
      var checksum;
      checksum = this.calcChecksum();
      return this.value = this.value + checksum;
    };
  
    C32.prototype.calcChecksum = function(ten) {
      if (ten == null) {
        ten = this.toTen();
      }
      return C32.CHECKSUM_POOL[ten % 37];
    };
  
    C32.prototype.isValid = function(value) {
      if (value == null) {
        value = this.value;
      }
      return value.substr(-1, 1) === this.calcChecksum(this.toTen(value.substring(0, value.length - 1)));
    };
  
    C32.prototype.getRandom = function(length) {
      var i;
      if (length == null) {
        length = 0;
      }
      return this.value = ((function() {
        var _i, _ref, _results;
        _results = [];
        for (i = _i = 0, _ref = length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {
          _results.push($(C32.POOL).getRandom());
        }
        return _results;
      })()).join("");
    };
  
    return C32;
  
  })();
  
  //# sourceMappingURL=c32.map
  