Skip to content

Commit 0d4d024

Browse files
committed
ImageProxyClient: Use create-hmac package instead of crypto
1 parent 5abdddf commit 0d4d024

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"cherow": "^1.6.9",
4242
"clone": "^2.1.1",
4343
"countries-list": "^2.5.1",
44+
"create-hmac": "^1.1.7",
4445
"is-buffer": "^2.0.3",
4546
"marked": "^1.1.0",
4647
"match-all": "^1.2.6",

src/image_proxy_client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import crypto from 'crypto';
1+
import createHmac from 'create-hmac';
22
import querystring from 'querystring';
33

44
/**
@@ -26,7 +26,7 @@ export default class ImageProxyClient {
2626
}
2727

2828
_createDigest(string) {
29-
const hmac = crypto.createHmac('sha1', this.hmacKey).update(string);
29+
const hmac = createHmac('sha1', this.hmacKey).update(string);
3030
return hmac.digest('hex');
3131
}
3232

0 commit comments

Comments
 (0)