@quentinadam/hash 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blake2b128.js +1 -1
- package/dist/blake2b160.js +1 -1
- package/dist/blake2b224.js +1 -1
- package/dist/blake2b256.js +1 -1
- package/dist/blake2b512.js +1 -1
- package/dist/generateHmac.js +3 -3
- package/dist/hmac-sha1.js +1 -1
- package/dist/hmac-sha224.js +1 -1
- package/dist/hmac-sha256.js +1 -1
- package/dist/hmac-sha384.js +1 -1
- package/dist/hmac-sha512.js +1 -1
- package/dist/md5.d.ts +2 -0
- package/dist/md5.js +5 -0
- package/dist/mod.d.ts +2 -1
- package/dist/mod.js +2 -1
- package/dist/ripemd160.js +1 -1
- package/dist/sha1.js +1 -1
- package/dist/sha224.js +1 -1
- package/dist/sha256.js +1 -1
- package/dist/sha384.js +1 -1
- package/dist/sha512.js +1 -1
- package/package.json +3 -2
package/dist/blake2b128.js
CHANGED
package/dist/blake2b160.js
CHANGED
package/dist/blake2b224.js
CHANGED
package/dist/blake2b256.js
CHANGED
package/dist/blake2b512.js
CHANGED
package/dist/generateHmac.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ensure from '@quentinadam/require';
|
|
2
2
|
import Uint8ArrayExtension from '@quentinadam/uint8array-extension';
|
|
3
3
|
import concat from "./concat.js";
|
|
4
4
|
export default function generateHmac(hash, blockSize) {
|
|
@@ -13,8 +13,8 @@ export default function generateHmac(hash, blockSize) {
|
|
|
13
13
|
const innerKey = new Uint8Array(blockSize);
|
|
14
14
|
const outerKey = new Uint8Array(blockSize);
|
|
15
15
|
for (let i = 0; i < blockSize; i++) {
|
|
16
|
-
innerKey[i] = 0x36 ^
|
|
17
|
-
outerKey[i] = 0x5c ^
|
|
16
|
+
innerKey[i] = 0x36 ^ ensure(secret[i]);
|
|
17
|
+
outerKey[i] = 0x5c ^ ensure(secret[i]);
|
|
18
18
|
}
|
|
19
19
|
return hash(Uint8ArrayExtension.concat([outerKey, hash(Uint8ArrayExtension.concat([innerKey, concat(buffers)]))]));
|
|
20
20
|
};
|
package/dist/hmac-sha1.js
CHANGED
package/dist/hmac-sha224.js
CHANGED
package/dist/hmac-sha256.js
CHANGED
package/dist/hmac-sha384.js
CHANGED
package/dist/hmac-sha512.js
CHANGED
package/dist/md5.d.ts
ADDED
package/dist/md5.js
ADDED
package/dist/mod.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ import hmacSha256 from './hmac-sha256.ts';
|
|
|
9
9
|
import hmacSha384 from './hmac-sha384.ts';
|
|
10
10
|
import hmacSha512 from './hmac-sha512.ts';
|
|
11
11
|
import keccak256 from './keccak256.ts';
|
|
12
|
+
import md5 from './md5.ts';
|
|
12
13
|
import ripemd160 from './ripemd160.ts';
|
|
13
14
|
import sha1 from './sha1.ts';
|
|
14
15
|
import sha224 from './sha224.ts';
|
|
15
16
|
import sha256 from './sha256.ts';
|
|
16
17
|
import sha384 from './sha384.ts';
|
|
17
18
|
import sha512 from './sha512.ts';
|
|
18
|
-
export { blake2b128, blake2b160, blake2b224, blake2b256, blake2b512, hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, keccak256, ripemd160, sha1, sha224, sha256, sha384, sha512, };
|
|
19
|
+
export { blake2b128, blake2b160, blake2b224, blake2b256, blake2b512, hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, keccak256, md5, ripemd160, sha1, sha224, sha256, sha384, sha512, };
|
package/dist/mod.js
CHANGED
|
@@ -9,10 +9,11 @@ import hmacSha256 from "./hmac-sha256.js";
|
|
|
9
9
|
import hmacSha384 from "./hmac-sha384.js";
|
|
10
10
|
import hmacSha512 from "./hmac-sha512.js";
|
|
11
11
|
import keccak256 from "./keccak256.js";
|
|
12
|
+
import md5 from "./md5.js";
|
|
12
13
|
import ripemd160 from "./ripemd160.js";
|
|
13
14
|
import sha1 from "./sha1.js";
|
|
14
15
|
import sha224 from "./sha224.js";
|
|
15
16
|
import sha256 from "./sha256.js";
|
|
16
17
|
import sha384 from "./sha384.js";
|
|
17
18
|
import sha512 from "./sha512.js";
|
|
18
|
-
export { blake2b128, blake2b160, blake2b224, blake2b256, blake2b512, hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, keccak256, ripemd160, sha1, sha224, sha256, sha384, sha512, };
|
|
19
|
+
export { blake2b128, blake2b160, blake2b224, blake2b256, blake2b512, hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, keccak256, md5, ripemd160, sha1, sha224, sha256, sha384, sha512, };
|
package/dist/ripemd160.js
CHANGED
package/dist/sha1.js
CHANGED
package/dist/sha224.js
CHANGED
package/dist/sha256.js
CHANGED
package/dist/sha384.js
CHANGED
package/dist/sha512.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quentinadam/hash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A simple hash library that wraps npm:@noble/hashes",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Quentin Adam",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"./hmac-sha384": "./dist/hmac-sha384.js",
|
|
23
23
|
"./hmac-sha512": "./dist/hmac-sha512.js",
|
|
24
24
|
"./keccak256": "./dist/keccak256.js",
|
|
25
|
+
"./md5": "./dist/md5.js",
|
|
25
26
|
"./ripemd160": "./dist/ripemd160.js",
|
|
26
27
|
"./sha1": "./dist/sha1.js",
|
|
27
28
|
"./sha224": "./dist/sha224.js",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"README.md"
|
|
35
36
|
],
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@noble/hashes": "^1.
|
|
38
|
+
"@noble/hashes": "^1.8.0",
|
|
38
39
|
"@quentinadam/require": "^0.1.4",
|
|
39
40
|
"@quentinadam/uint8array-extension": "^0.1.5"
|
|
40
41
|
}
|