lib/client.js
function(method, url, date) {
        var timestamp = (date || new Date()).toISOString().replace(/\.\d+Z$/, 'Z'),
            addPubKey = this.options.user !== this.options.publicKey,
            qs = url.toString().indexOf('?') > -1 ? '&' : '?',
            signUrl = addPubKey ? url + qs + 'publicKey=' + this.options.publicKey : url,
            signature = this.generateSignature(method, signUrl.toString(), timestamp);

        qs = addPubKey ? '&' : qs;
        qs += 'signature=' + encodeURIComponent(signature);
        qs += '&timestamp=' + encodeURIComponent(timestamp);

        return signUrl + qs;
    }
function(method, url, date) {
        var timestamp = (date || new Date()).toISOString().replace(/\.\d+Z$/, 'Z'),
            addPubKey = this.options.user !== this.options.publicKey,
            qs = url.toString().indexOf('?') > -1 ? '&' : '?',
            signUrl = addPubKey ? url + qs + 'publicKey=' + this.options.publicKey : url,
            signature = this.generateSignature(method, signUrl.toString(), timestamp);

        qs = addPubKey ? '&' : qs;
        qs += 'signature=' + encodeURIComponent(signature);
        qs += '&timestamp=' + encodeURIComponent(timestamp);

        return signUrl + qs;
    }
function ( method , url , date ) { var timestamp = ( date || new Date ( ) ) . toISOString ( ) . replace ( / \.\d+Z$ / , 'Z' ) , addPubKey = this . options . user !== this . options . publicKey , qs = url . toString ( ) . indexOf ( '?' ) > - 1 ? '&' : '?' , signUrl = addPubKey ? url + qs + 'publicKey=' + this . options . publicKey : url , signature = this . generateSignature ( method , signUrl . toString ( ) , timestamp ) ; qs = addPubKey ? '&' : qs ; qs += 'signature=' + encodeURIComponent ( signature ) ; qs += '&timestamp=' + encodeURIComponent ( timestamp ) ; return signUrl + qs ; }
Get a signed version of a given URL

@param  {String} method - HTTP method
@param  {String} url    - Endpoint URL
@param  {Date}   [date] - Date to use for signing request
@return {String}
Get a signed version of a given URL