docs: function genOAuthSig (options) {
  
      log(options.verbose,"Now generating OAuth sig ...");
  
      // Build an array of all the parameters we need to include in the signature.
      // Signature parameters are in the format {key,value}, both the key and the
      // value need to be RFC3986 percent encoded.
  
      var sigParams  = [];
  
      if ( options.queryParams ) {
          Object.keys(options.queryParams).forEach(function (key) {
              sigParams.push(createEncodedParam(key,options.queryParams[key]));
          });
      }
  
      sigParams.push(createEncodedParam("oauth_consumer_key",options.oAuthConsumerKey));
      sigParams.push(createEncodedParam("oauth_nonce",options.oAuthNonce));
      sigParams.push(createEncodedParam("oauth_signature_method",options.oAuthSignatureMethod));
      sigParams.push(createEncodedParam("oauth_timestamp",options.oAuthTimestamp));
      sigParams.push(createEncodedParam("oauth_token",options.oAuthToken));
      sigParams.push(createEncodedParam("oauth_version",options.oAuthVersion));
  
      // Parameters need to be sorted alphabetically based on the encoded key.
  
      sigParams.sort(function (a,b) {
          if ( a.key < b.key ) {
              return -1;
          } else if ( a.key > b.key ) {
              return 1;
          } else {
              return 0;
          }
      });
  
      // Build the signature parameter string from the sorted array.
  
      var sigParamsString = "";
  
      log(options.verbose,"Ordered percent encoded sig params are:");
  
      for ( var i=0; i<sigParams.length; i++ ) {
          sigParamsString += sigParams[i].key+"="+sigParams[i].value;
          log(options.verbose,"  "+sigParams[i].key+"="+sigParams[i].value);
          if ( sigParams[i+1] ) {
              sigParamsString += "&";
          }
      }
  
      log(options.verbose,"Generated sig params string: "+sigParamsString);
  
      // Build the base signature string from the HTTP method, base URL and signature
      // parameter string.
  
      var sigBaseString = options.method.toUpperCase()+"&";
      sigBaseString += percentEncode(options.baseURL)+"&";
      sigBaseString += percentEncode(sigParamsString);
  
      log(options.verbose,"Generated base sig string: "+sigBaseString);
  
      // Generate the signing key from the consumer secret and oAuth token secret.
  
      var signingKey = options.oAuthConsumerSecret+"&"+options.oAuthTokenSecret;
  
      log(options.verbose,"Generated HMAC-SHA1 signing key: "+signingKey);
  
      // The final value for the OAuth signature is the HMAC-SHA1 hash of the
      // signing key and the base sig string, all base64 encoded.
  
      var oAuthSig = crypto.createHmac("sha1",signingKey).update(sigBaseString).digest("base64");
  
      log(options.verbose,"OAuth sig is: "+oAuthSig);
  
      return oAuthSig;
  }