Merge pull request #3008 from mozilla/rm-config-hash
fix(config): remove hash alg from config
This commit is contained in:
Коммит
1f82d473c1
|
@ -102,12 +102,6 @@ const conf = convict({
|
|||
default: true
|
||||
}
|
||||
},
|
||||
encrypt: {
|
||||
hashAlg: {
|
||||
doc: 'Hash algorithm for storing secrets/codes/tokens.',
|
||||
default: 'sha256'
|
||||
}
|
||||
},
|
||||
env: {
|
||||
arg: 'node-env',
|
||||
doc: 'The current node.js environment',
|
||||
|
|
|
@ -3,13 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const crypto = require('crypto');
|
||||
|
||||
const buf = require('buf').hex;
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
exports.hash = function hash(value) {
|
||||
var sha = crypto.createHash(config.get('encrypt.hashAlg'));
|
||||
var sha = crypto.createHash('sha256');
|
||||
sha.update(buf(value));
|
||||
return sha.digest();
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче