@libp2p/crypto 0.22.6 → 0.22.9
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/src/pbkdf2.d.ts +1 -1
- package/dist/src/pbkdf2.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/pbkdf2.ts +1 -1
package/dist/src/pbkdf2.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Computes the Password-Based Key Derivation Function 2.
|
|
3
3
|
*/
|
|
4
|
-
export default function pbkdf2(password: string, salt: string, iterations: number, keySize: number, hash: string):
|
|
4
|
+
export default function pbkdf2(password: string, salt: string, iterations: number, keySize: number, hash: string): string;
|
|
5
5
|
//# sourceMappingURL=pbkdf2.d.ts.map
|
package/dist/src/pbkdf2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src/pbkdf2.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src/pbkdf2.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBzH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/crypto",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.9",
|
|
4
4
|
"description": "Crypto primitives for libp2p",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p-crypto#readme",
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
"build:proto:types": "pbts -o src/keys/keys.d.ts src/keys/keys.js"
|
|
172
172
|
},
|
|
173
173
|
"dependencies": {
|
|
174
|
-
"@noble/ed25519": "^1.
|
|
175
|
-
"@noble/secp256k1": "^1.
|
|
174
|
+
"@noble/ed25519": "^1.6.0",
|
|
175
|
+
"@noble/secp256k1": "^1.5.4",
|
|
176
176
|
"err-code": "^3.0.1",
|
|
177
177
|
"iso-random-stream": "^2.0.0",
|
|
178
178
|
"multiformats": "^9.4.5",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"@types/mocha": "^9.0.0",
|
|
185
185
|
"aegir": "^36.1.2",
|
|
186
186
|
"benchmark": "^2.1.4",
|
|
187
|
-
"sinon": "^
|
|
187
|
+
"sinon": "^13.0.1",
|
|
188
188
|
"util": "^0.12.3",
|
|
189
189
|
"wherearewe": "^1.0.0"
|
|
190
190
|
},
|
package/src/pbkdf2.ts
CHANGED
|
@@ -20,7 +20,7 @@ const hashName = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Computes the Password-Based Key Derivation Function 2.
|
|
22
22
|
*/
|
|
23
|
-
export default function pbkdf2 (password: string, salt: string, iterations: number, keySize: number, hash: string) {
|
|
23
|
+
export default function pbkdf2 (password: string, salt: string, iterations: number, keySize: number, hash: string): string {
|
|
24
24
|
if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') {
|
|
25
25
|
const types = Object.keys(hashName).join(' / ')
|
|
26
26
|
throw errcode(new Error(`Hash '${hash}' is unknown or not supported. Must be ${types}`), 'ERR_UNSUPPORTED_HASH_TYPE')
|