changed methods for encrypt

This commit is contained in:
DwCay
2022-08-03 12:02:44 +03:00
parent a86dd13e0e
commit b2d5df9533

View File

@@ -55,7 +55,7 @@ class Store {
fetchWrapper.postAuth('data/private', { fetchWrapper.postAuth('data/private', {
networkIdentifier: this.nodeInfo.networkIdentifier, networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID lastBlockID: this.nodeInfo.lastBlockID
}, [...this.encryptUserData(data)]) }, [...this.encryptAccountData(data)])
.then(() => this.fetchNewAccountData()) .then(() => this.fetchNewAccountData())
} }
@@ -180,7 +180,7 @@ class Store {
})) }))
} }
encryptUserData(data) { encryptAccountData(data) {
return data.map((item) => { return data.map((item) => {
let value = cryptography.encryptMessageWithPassphrase(cryptography.getRandomBytes(32).toString('hex') + ":" + item.value, this.passPhrase, this.pubKey); let value = cryptography.encryptMessageWithPassphrase(cryptography.getRandomBytes(32).toString('hex') + ":" + item.value, this.passPhrase, this.pubKey);
return { return {