Skip to content

Commit

Permalink
Merge pull request #96 from dandv/patch-1
Browse files Browse the repository at this point in the history
Add ES6 import example
  • Loading branch information
evanvosberg committed Jun 2, 2017
2 parents 4338ce0 + 88c99ab commit 73c20dd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -15,6 +15,18 @@ npm install crypto-js

### Usage

ES6 import for typical API call signing use case:

```javascript
import sha256 from 'crypto-js/sha256';
import hmacSHA512 from 'crypto-js/hmac-sha512';
import Base64 from 'crypto-js/enc-base64';

const message, nonce, path, privateKey; // ...
const hashDigest = sha256(nonce + message);
const hmacDigest = Base64.stringify(hmacSHA512(path + hashDigest, privateKey));
```

Modular include:

```javascript
Expand Down

0 comments on commit 73c20dd

Please sign in to comment.