| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,6 @@ const { | |||
| 20 | 20 | ||
| 21 | 21 | const { | |
| 22 | 22 | getArrayBufferOrView, | |
| 23 | - getDefaultEncoding, | ||
| 24 | 23 | normalizeHashName, | |
| 25 | 24 | kKeyObject, | |
| 26 | 25 | } = require('internal/crypto/util'); | |
@@ -49,14 +48,11 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) { | |||
| 49 | 48 | keylen, | |
| 50 | 49 | digest); | |
| 51 | 50 | ||
| 52 | - const encoding = getDefaultEncoding(); | ||
| 53 | 51 | job.ondone = (err, result) => { | |
| 54 | 52 | if (err !== undefined) | |
| 55 | 53 | return FunctionPrototypeCall(callback, job, err); | |
| 56 | 54 | const buf = Buffer.from(result); | |
| 57 | - if (encoding === 'buffer') | ||
| 58 | - return FunctionPrototypeCall(callback, job, null, buf); | ||
| 59 | - FunctionPrototypeCall(callback, job, null, buf.toString(encoding)); | ||
| 55 | + return FunctionPrototypeCall(callback, job, null, buf); | ||
| 60 | 56 | }; | |
| 61 | 57 | ||
| 62 | 58 | job.run(); | |
@@ -78,9 +74,7 @@ function pbkdf2Sync(password, salt, iterations, keylen, digest) { | |||
| 78 | 74 | if (err !== undefined) | |
| 79 | 75 | throw err; | |
| 80 | 76 | ||
| 81 | - const buf = Buffer.from(result); | ||
| 82 | - const encoding = getDefaultEncoding(); | ||
| 83 | - return encoding === 'buffer' ? buf : buf.toString(encoding); | ||
| 77 | + return Buffer.from(result); | ||
| 84 | 78 | } | |
| 85 | 79 | ||
| 86 | 80 | function check(password, salt, iterations, keylen, digest) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments