@sequencemedia/pbkdf2 1.0.8 → 1.0.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/README.md +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,13 @@ Etc.
|
|
|
23
23
|
The password is expected as the first argument, while the others are fields on a params object
|
|
24
24
|
|
|
25
25
|
```javascript
|
|
26
|
-
const isValid = await compare(password, {
|
|
26
|
+
const isValid = await compare(password, {
|
|
27
|
+
hash,
|
|
28
|
+
salt,
|
|
29
|
+
iterations,
|
|
30
|
+
keylen,
|
|
31
|
+
digest
|
|
32
|
+
})
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
### `hash`
|
|
@@ -31,16 +37,22 @@ const isValid = await compare(password, { hash, salt, iterations, keylen, digest
|
|
|
31
37
|
As with `compare`, the password is expected as the first argument, while the others are fields on a params object (except for `hash` which can of course be omitted)
|
|
32
38
|
|
|
33
39
|
```javascript
|
|
34
|
-
const value = await hash(password, {
|
|
40
|
+
const value = await hash(password, {
|
|
41
|
+
hash,
|
|
42
|
+
iterations,
|
|
43
|
+
keylen,
|
|
44
|
+
digest
|
|
45
|
+
})
|
|
35
46
|
```
|
|
36
47
|
|
|
37
48
|
### `salt`
|
|
38
49
|
|
|
39
|
-
An `async` wrapper around `crypto.randomBytes` to _generate_ a salt from the salt size
|
|
50
|
+
An `async` wrapper around `crypto.randomBytes()` to _generate_ a salt from the salt size
|
|
40
51
|
|
|
41
52
|
```javascript
|
|
42
53
|
const value = await salt(size)
|
|
43
54
|
```
|
|
55
|
+
|
|
44
56
|
## In the shell
|
|
45
57
|
|
|
46
58
|
Scripts are exposed to `npm` in the package and each script can of course be invoked from the command line directly in the shell
|