|
|
@@ -3,6 +3,7 @@ import crypto from 'crypto'; |
|
|
|
module.exports = { |
|
|
|
encryptLogin: _encryptLogin, |
|
|
|
renderPassword: _renderPassword, |
|
|
|
createFingerprint: createFingerprint, |
|
|
|
_deriveEncryptedLogin, |
|
|
|
_getPasswordTemplate, |
|
|
|
_prettyPrint, |
|
|
@@ -102,3 +103,9 @@ function _getPasswordChar(charType, index) { |
|
|
|
const passwordChar = passwordsChars[charType]; |
|
|
|
return passwordChar[index % passwordChar.length]; |
|
|
|
} |
|
|
|
|
|
|
|
function createFingerprint(str) { |
|
|
|
return new Promise(resolve => { |
|
|
|
resolve(crypto.createHmac('sha256', str).digest('hex')) |
|
|
|
}); |
|
|
|
} |