code: function hex2decimal(hex, scale) {
      if (typeof Buffer !== 'undefined' && hex instanceof Buffer) {
        hex = hex.toString('hex');
      }
      if (typeof hex !== 'string') {
        hex = String(hex);
      }
      if (!(/^[0-9a-fA-F]+$/.test(hex))) {
        return hex;
      }
      scale = scale || 10;
      var res = '0';
      var i = 0;
      while(i < hex.length) {
        var n = hex[hex.length - 1 - i];
        var j = i;
        while(j--) {
          n = multiply(n, 16, scale);
        }
        res = add(res, n, scale);
        i++;
      }
      return res;
    }
docs: /*
  @main
  @desc convert hex to decimal
  @params {String} hex string
  @params {Number} scale
  @return {String} decimal string