Merge pull request #1737 from eordano/fix/passphrase
Passphrase getting generated correctly
This commit is contained in:
commit
e8a376cf31
5 changed files with 242 additions and 10 deletions
|
|
@ -24,6 +24,17 @@ module.exports = {
|
|||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} key
|
||||
* @param {string} data
|
||||
* @return {string} base64 encoded hmac
|
||||
*/
|
||||
hmac: function(key, data) {
|
||||
return sjcl.codec.base64.fromBits(
|
||||
new sjcl.misc.hmac(key, sjcl.hash.sha256).encrypt(data)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} password
|
||||
* @param {string} salt - base64 encoded, defaults to 'mjuBtGybi/4='
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue