File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
- import { Digest } from "./Digest" ;
1
+ import { Digest } from "./Digest"
2
2
/**
3
3
* A HMAC ( commonly referred to as a Hash ) (hash-based message authentication
4
4
* code) is a type of message authentication code (MAC) that uses a
@@ -13,12 +13,12 @@ import { Digest } from "./Digest";
13
13
* will vary based on the implementing class.
14
14
*/
15
15
export abstract class HMAC extends Digest {
16
- /**
17
- * Create a new HMAC Encrypter.
18
- *
19
- * @param secretKey - The shared secret to use for encryption.
20
- */
21
- constructor ( protected secretKey : Buffer ) {
22
- super ( )
23
- }
16
+ /**
17
+ * Create a new HMAC Encrypter.
18
+ *
19
+ * @param secretKey - The shared secret to use for encryption.
20
+ */
21
+ constructor ( protected secretKey : Buffer ) {
22
+ super ( )
23
+ }
24
24
}
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import { createHmac } from "crypto"
9
9
* on the build flags of the underlying runtime.
10
10
*/
11
11
export class SHA1HMAC extends HMAC {
12
- public async calculate ( input : Buffer ) : Promise < Buffer > {
13
- let hmacBuilder = createHmac ( "sha1" , this . secretKey )
14
- hmacBuilder . update ( input )
12
+ public async calculate ( input : Buffer ) : Promise < Buffer > {
13
+ let hmacBuilder = createHmac ( "sha1" , this . secretKey )
14
+ hmacBuilder . update ( input )
15
15
16
- return hmacBuilder . digest ( )
17
- }
16
+ return hmacBuilder . digest ( )
17
+ }
18
18
}
You can’t perform that action at this time.
0 commit comments