@sequencemedia/pbkdf2 1.0.10 → 1.0.12
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 +5 -3
- package/compare.sh +1 -1
- package/package.json +60 -60
- package/utils/common.mjs +0 -8
package/README.md
CHANGED
|
@@ -13,8 +13,10 @@ A password can be compared with a `hash` and `salt` (and the number of `iteratio
|
|
|
13
13
|
The ES functions expect the same argument types as the underlying Node utilities
|
|
14
14
|
|
|
15
15
|
- The `hash` is a `Buffer`
|
|
16
|
-
- The `salt` is a `
|
|
16
|
+
- The `salt` is a `Buffer`
|
|
17
17
|
- `iterations` is a `Number`
|
|
18
|
+
- `keylen` is a `Number`
|
|
19
|
+
- `digest` is a `String`
|
|
18
20
|
|
|
19
21
|
Etc.
|
|
20
22
|
|
|
@@ -89,8 +91,8 @@ npm run compare -- \
|
|
|
89
91
|
|
|
90
92
|
Etc.
|
|
91
93
|
|
|
92
|
-
- The `hash` is decoded to a `Buffer`
|
|
93
|
-
- The `salt` is
|
|
94
|
+
- The `hash` is decoded from a _Base64_ `String` to a `Buffer`
|
|
95
|
+
- The `salt` is decoded from a _Base64_ `String` to a `Buffer`
|
|
94
96
|
|
|
95
97
|
## Tests
|
|
96
98
|
|
package/compare.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sequencemedia/pbkdf2",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"keywords": [
|
|
5
|
-
"pbkdf2",
|
|
6
|
-
"crypto",
|
|
7
|
-
"compare",
|
|
8
|
-
"hash",
|
|
9
|
-
"salt",
|
|
10
|
-
"ecmascript",
|
|
11
|
-
"typescript"
|
|
12
|
-
],
|
|
13
|
-
"main": "./index.mjs",
|
|
14
|
-
"type": "module",
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "Jonathan Perry for Sequence Media Limited",
|
|
17
|
-
"email": "sequencemedia@sequencemedia.net",
|
|
18
|
-
"url": "http://sequencemedia.net"
|
|
19
|
-
},
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git@github.com:sequencemedia/pbkdf2.git"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"lint": "eslint . --ext .mjs --ext .cjs",
|
|
27
|
-
"lint:fix": "npm run lint -- --fix",
|
|
28
|
-
"test": "cross-env NODE_ENV=test mocha tests --recursive --verbose --color",
|
|
29
|
-
"compare": "node scripts/compare.mjs",
|
|
30
|
-
"hash": "node scripts/hash.mjs",
|
|
31
|
-
"salt": "node scripts/salt.mjs",
|
|
32
|
-
"prepare": "husky install"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"debug": "^4.3.4",
|
|
36
|
-
"yargs-parser": "^21.1.1"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@babel/cli": "^7.20.7",
|
|
40
|
-
"@babel/core": "^7.20.12",
|
|
41
|
-
"@babel/eslint-parser": "^7.19.1",
|
|
42
|
-
"@babel/preset-env": "^7.20.2",
|
|
43
|
-
"@sequencemedia/hooks": "^1.0.320",
|
|
44
|
-
"@types/node": "^18.11.18",
|
|
45
|
-
"chai": "^4.3.7",
|
|
46
|
-
"core-js": "^3.27.2",
|
|
47
|
-
"cross-env": "^7.0.3",
|
|
48
|
-
"eslint": "^8.33.0",
|
|
49
|
-
"eslint-config-standard": "^17.0.0",
|
|
50
|
-
"eslint-plugin-import": "^2.27.5",
|
|
51
|
-
"eslint-plugin-node": "^11.1.0",
|
|
52
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
53
|
-
"husky": "^8.0.3",
|
|
54
|
-
"mocha": "^10.2.0"
|
|
55
|
-
},
|
|
56
|
-
"imports": {
|
|
57
|
-
"#config/*": "./config/*.mjs",
|
|
58
|
-
"#utils/*": "./utils/*.mjs"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sequencemedia/pbkdf2",
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"pbkdf2",
|
|
6
|
+
"crypto",
|
|
7
|
+
"compare",
|
|
8
|
+
"hash",
|
|
9
|
+
"salt",
|
|
10
|
+
"ecmascript",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
13
|
+
"main": "./index.mjs",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Jonathan Perry for Sequence Media Limited",
|
|
17
|
+
"email": "sequencemedia@sequencemedia.net",
|
|
18
|
+
"url": "http://sequencemedia.net"
|
|
19
|
+
},
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git@github.com:sequencemedia/pbkdf2.git"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"lint": "eslint . --ext .mjs --ext .cjs",
|
|
27
|
+
"lint:fix": "npm run lint -- --fix",
|
|
28
|
+
"test": "cross-env NODE_ENV=test mocha tests --recursive --verbose --color",
|
|
29
|
+
"compare": "node scripts/compare.mjs",
|
|
30
|
+
"hash": "node scripts/hash.mjs",
|
|
31
|
+
"salt": "node scripts/salt.mjs",
|
|
32
|
+
"prepare": "husky install"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"debug": "^4.3.4",
|
|
36
|
+
"yargs-parser": "^21.1.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@babel/cli": "^7.20.7",
|
|
40
|
+
"@babel/core": "^7.20.12",
|
|
41
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
42
|
+
"@babel/preset-env": "^7.20.2",
|
|
43
|
+
"@sequencemedia/hooks": "^1.0.320",
|
|
44
|
+
"@types/node": "^18.11.18",
|
|
45
|
+
"chai": "^4.3.7",
|
|
46
|
+
"core-js": "^3.27.2",
|
|
47
|
+
"cross-env": "^7.0.3",
|
|
48
|
+
"eslint": "^8.33.0",
|
|
49
|
+
"eslint-config-standard": "^17.0.0",
|
|
50
|
+
"eslint-plugin-import": "^2.27.5",
|
|
51
|
+
"eslint-plugin-node": "^11.1.0",
|
|
52
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
53
|
+
"husky": "^8.0.3",
|
|
54
|
+
"mocha": "^10.2.0"
|
|
55
|
+
},
|
|
56
|
+
"imports": {
|
|
57
|
+
"#config/*": "./config/*.mjs",
|
|
58
|
+
"#utils/*": "./utils/*.mjs"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/utils/common.mjs
CHANGED
|
@@ -5,11 +5,3 @@ export function fromBase64ToBuffer (string) {
|
|
|
5
5
|
export function fromBufferToBase64 (buffer) {
|
|
6
6
|
return buffer.toString('base64')
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
export function fromBase64 (string) {
|
|
10
|
-
return Buffer.from(string, 'base64').toString('ascii')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function toBase64 (string) {
|
|
14
|
-
return Buffer.from(string).toString('base64')
|
|
15
|
-
}
|