Skip to content

Commit

Permalink
Merge pull request #13 from aptoma/bump-deps-remove-crypto
Browse files Browse the repository at this point in the history
Update deps, remove crypto lib
  • Loading branch information
gunnarlium authored May 7, 2024
2 parents edfaae6 + 18dbb29 commit 1fb0471
Show file tree
Hide file tree
Showing 4 changed files with 5,232 additions and 2,562 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
16
20

6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const qs = require('qs');
const hmacSHA256 = require('crypto-js/hmac-sha256');
const crypto = require('crypto');

const cropper = require('./crop');

Expand Down Expand Up @@ -47,7 +47,9 @@ exports.getResizedImageUrl = (imageUrl, targetSize, actions, transformToken, par
}

function createSignature(key, url) {
return hmacSHA256(url, key);
return crypto.createHmac('sha256', key)
.update(url)
.digest('hex');
}
}
};
Expand Down
Loading

0 comments on commit 1fb0471

Please sign in to comment.