lib/headers.js
function digitalSignature(custom, request, epoch) {
    /**
     * Node Crypto Sign object that uses the given algorithm.
     *
     * @see {@link https://nodejs.org/api/crypto.html#crypto_class_sign}
     */
    const signer = crypto_1.createSign('RSA-SHA256');
    /**
     * Walmart API request string to be signed.
     */
    let stringToSign = custom.WMConsumer.ConsumerId + "\n" + request.RequestUrl + "\n"
        + request.RequestMethod.toUpperCase() + "\n" + epoch + "\n";
    /**
     * Updates the Sign content with the given data.
     * @see {@link https://nodejs.org/api/crypto.html#crypto_sign_update_data_inputencoding}
     */
    signer.update(stringToSign);
    /**
     * Private key wrapped in key header and footer.
     */
    let privateKey = "-----BEGIN PRIVATE KEY-----\n" + request.PrivateKey + "\n-----END PRIVATE KEY-----";
    return signer.sign(privateKey, 'base64');
}
function digitalSignature(custom, request, epoch) {
    /**
     * Node Crypto Sign object that uses the given algorithm.
     *
     * @see {@link https://nodejs.org/api/crypto.html#crypto_class_sign}
     */
    const signer = crypto_1.createSign('RSA-SHA256');
    /**
     * Walmart API request string to be signed.
     */
    let stringToSign = custom.WMConsumer.ConsumerId + "\n" + request.RequestUrl + "\n"
        + request.RequestMethod.toUpperCase() + "\n" + epoch + "\n";
    /**
     * Updates the Sign content with the given data.
     * @see {@link https://nodejs.org/api/crypto.html#crypto_sign_update_data_inputencoding}
     */
    signer.update(stringToSign);
    /**
     * Private key wrapped in key header and footer.
     */
    let privateKey = "-----BEGIN PRIVATE KEY-----\n" + request.PrivateKey + "\n-----END PRIVATE KEY-----";
    return signer.sign(privateKey, 'base64');
}
function digitalSignature ( custom , request , epoch ) { /**
     * Node Crypto Sign object that uses the given algorithm.
     *
     * @see {@link https://nodejs.org/api/crypto.html#crypto_class_sign}
     */ const signer = crypto_1 . createSign ( 'RSA-SHA256' ) ; /**
     * Walmart API request string to be signed.
     */ let stringToSign = custom . WMConsumer . ConsumerId + "\n" + request . RequestUrl + "\n" + request . RequestMethod . toUpperCase ( ) + "\n" + epoch + "\n" ; /**
     * Updates the Sign content with the given data.
     * @see {@link https://nodejs.org/api/crypto.html#crypto_sign_update_data_inputencoding}
     */ signer . update ( stringToSign ) ; /**
     * Private key wrapped in key header and footer.
     */ let privateKey = "-----BEGIN PRIVATE KEY-----\n" + request . PrivateKey + "\n-----END PRIVATE KEY-----" ; return signer . sign ( privateKey , 'base64' ) ; }
Generates the digital signature required for the API request.

@param custom  Walmart authentication headers. Use the custom class to set custom
values to the headers before adding to the request.
@param request The request properties required to generate the digital signature.
@param epoch   An Epoch timestamp is required for the digital signature.
Generates the digital signature required for the API request .