1.0.5 • Published 11 months ago

signature_calculator v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Introduction

This library is aimed to provide a consistent way to handle HMAC authentication between platforms.

Scripts

Run npm run build to build this lib.

Basic Usage

/**
 * Your secret
 */
const secret = "xxxxxxxxxxxxxxx";

/**
 * For https://example.com/test
 */
const endpointUrl = "/test";
/**
 *  Your payload that is about to be sent over the network. 
 */
const  payload = {
    field_1: "string",
    field_2: "string",
    field_3: 100
};

const signatureInstance = new Signature(secret);

const hash = signatureInstance.getSignature({
    ...payload,
    url: endpointUrl
});

// you can now use hash.

Note: that you must provide url as part of signature creation.

Good Luck!

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago