Skip to content

Commit

Permalink
Add ES6 import example
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored Jun 1, 2017
1 parent 4338ce0 commit 88c99ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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 88c99ab

Please sign in to comment.