Comparing version 0.0.13 to 0.0.14
@@ -5,4 +5,8 @@ const CryptoJS = require("crypto-js"); | ||
const our_password = password ? password : "mnemonic" | ||
const decrypted = CryptoJS.AES.decrypt(encryptedSeedPhrase, our_password); | ||
return decrypted.toString(CryptoJS.enc.Utf8) | ||
try { | ||
const decrypted = CryptoJS.AES.decrypt(encryptedSeedPhrase, our_password) | ||
return decrypted.toString(CryptoJS.enc.Utf8) | ||
} catch(err) { | ||
return "" | ||
} | ||
}; |
@@ -6,7 +6,2 @@ const bitcoin = require("bitcoinjs-lib") | ||
if(network==undefined) network = networkUtils.DEFAULT_NETWORK | ||
/* const { address } = bitcoin.payments.p2pkh({ | ||
pubkey: publicKey, | ||
network: network, | ||
}); | ||
return address*/ | ||
} |
{ | ||
"name": "doichain", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "A js-Doichain library. The goal is to fully cover the Doichain protocoll", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -116,2 +116,5 @@ import chai from 'chai' | ||
chai.assert.equal(decryptedSeedPhrase,SEEDPHRASE,"seed phrase not decrypted") | ||
const decryptedSeedPhrase2 = decryptAES(encryptedSeedPhrase, "wrongPassword") | ||
chai.assert.notEqual(decryptedSeedPhrase2,SEEDPHRASE,"this is completely impossible") | ||
chai.assert.equal(decryptedSeedPhrase2,"","this is not empty") | ||
}) | ||
@@ -118,0 +121,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23522
490