-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from konsultaner/master
add possibility to use two instances in parallel
- Loading branch information
Showing
12 changed files
with
148 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var data = {data: [{age: 1}, {age: '2'}]}; | ||
var aesCRealm1 = new SecureLS({encodingType: 'aes', encryptionSecret: 'secret1', encryptionNamespace: 'realm1'}); | ||
var key1 = 'aes__compressed_1'; | ||
var ae = aesCRealm1.AES.encrypt(JSON.stringify(data), ''); | ||
var bde = aesCRealm1.AES.decrypt(ae.toString(), ''); | ||
var de = bde.toString(aesCRealm1.enc._Utf8); | ||
var aesCRealm2 = new SecureLS({encodingType: 'aes', encryptionSecret: 'secret2', encryptionNamespace: 'realm2'}); | ||
var key2 = 'aes__compressed_2'; | ||
var ae2 = aesCRealm2.AES.encrypt(JSON.stringify(data), ''); | ||
var bde2 = aesCRealm2.AES.decrypt(ae2.toString(), ''); | ||
var de2 = bde2.toString(aesCRealm2.enc._Utf8); | ||
|
||
aesCRealm1.set(key1, data); | ||
console.log('AES Compressed Realm1'); | ||
console.log(localStorage.getItem(key1)); | ||
console.log(aesCRealm1.get(key1)); | ||
console.log('____________________________________'); | ||
|
||
aesCRealm2.set(key2, data); | ||
console.log('AES Compressed Realm2'); | ||
console.log(localStorage.getItem(key2)); | ||
console.log(aesCRealm2.get(key2)); | ||
console.log('____________________________________'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters