Closed leomartinsm closed 3 years ago
As shown on the README.md you must supply your own hash, encrypt, and decrypt functions.
if you don't wish to hash the key, use an identity function for the hash:
var secureStorage = new SecureStorage(localStorage, {
hash: function hash(key) {
return key;
},
encrypt: function encrypt(data) {
data = CryptoJS.AES.encrypt(data, SECRET_KEY);
data = data.toString();
return data;
},
decrypt: function decrypt(data) {
data = CryptoJS.AES.decrypt(data, SECRET_KEY);
data = data.toString(CryptoJS.enc.Utf8);
return data;
}
});
i have an error _.hash, but i don't need to hash the key, my problem is relative only for the value