Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
encryptSeed(stringifyUsers, this.password, 10000);
const saveData = {
encrypted: this.needPassword,
encryptionRounds: this.needPassword ? 10000 : undefined,
saveUsers
};
const dataToSaveInBytes = crypto.stringToBytes(JSON.stringify(saveData));
saveData.hashSum = crypto.base58Encode(crypto.sha256(dataToSaveInBytes));
const toSave = {
type: 'wavesBackup',
lastOpenVersion: this.settings.lastOpenVersion,
data: crypto.base64Encode(crypto.stringToBytes(JSON.stringify(saveData))),
checkSum: saveData.hashSum,
time: Date.now()
};
utils.downloadFile(`accountsBackup-${toSave.time}.json`, JSON.stringify(toSave, null, 4));
}