signPath(resource) {
    var token = this.token;
    if (token) {
      var data = token.substring(0, token.length - 40);
      var sig = token.substring(data.length);

      var path = resource.split('/').map(encodeURIComponent).join('/');
      return path + '?BAT=' + (data + hmac(resource + data, sig));
    }
    return resource;
  }
/**
   * Derived a resource token from the the stored origin token for the resource and signs the resource with the
   * generated resource token
   * @param {string} resource The resource which will be accessible with the returned token
   * @returns {string} A resource token which can only be used to access the specified resource
   */
Derived a resource token from the the stored origin token for the resource and signs the resource with the
generated resource token
@param {string} resource The resource which will be accessible with the returned token
@returns {string} A resource token which can only be used to access the specified resource
Derived a resource token from the the stored origin token for the resource and signs the resource with the generated resource token @param { string } resource The resource which will be accessible with the returned token @returns { string } A resource token which can only be used to access the specified resource
signPath(resource) {
    var token = this.token;
    if (token) {
      var data = token.substring(0, token.length - 40);
      var sig = token.substring(data.length);
      var path = resource.split('/').map(encodeURIComponent).join('/');
      return path + '?BAT=' + (data + hmac(resource + data, sig));
    }
    return resource;
  }
signPath ( resource ) { var token = this . token ; if ( token ) { var data = token . substring ( 0 , token . length - 40 ) ; var sig = token . substring ( data . length ) ; var path = resource . split ( '/' ) . map ( encodeURIComponent ) . join ( '/' ) ; return path + '?BAT=' + ( data + hmac ( resource + data , sig ) ) ; } return resource ; }
Derived a resource token from the the stored origin token for the resource and signs the resource with the
 generated resource token
 @param {string} resource The resource which will be accessible with the returned token
 @returns {string} A resource token which can only be used to access the specified resource
Derived a resource token from the the stored origin token for the resource and signs the resource with the generated resource token @param { string } resource The resource which will be accessible with the returned token @returns { string } A resource token which can only be used to access the specified resource