Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@ encoding method is choosen.
`encryptionNamespace` is used to make multiple instances with different `encryptionSecret`
and/or different `encryptionSecret` possible.

var ls1 = new SecureLS({encodingType: 'des', encryptionSecret: 'my-secret-key-1'});
var ls2 = new SecureLS({encodingType: 'aes', encryptionSecret: 'my-secret-key-2'});
var ls1 = new SecureLS({
encodingType: 'des',
encryptionSecret: 'my-secret-key-1',
encryptionNamespace: 'user-1'
});
var ls2 = new SecureLS({
encodingType: 'aes',
encryptionSecret: 'my-secret-key-2',
encryptionNamespace: 'user-2'
});

**Examples:**

Expand Down
13 changes: 10 additions & 3 deletions dist/secure-ls.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import * as LZString from 'lz-string';
import {CipherHelper, Encoder} from 'crypto-js';

declare class SecureLS {
constructor(config?: { isCompression?: boolean, encodingType?: string, encryptionSecret?: string , encryptionNamespace?: string });
constructor(config?: {
isCompression?: boolean,
encodingType?: string,
encryptionSecret?: string,
encryptionNamespace?: string,
storage?: Storage
});
getEncryptionSecret(): string;
get(key: string, isAllKeysData?: boolean): any;
getDataFromLocalStorage(key: string): string | null;
Expand All @@ -14,7 +20,7 @@ declare class SecureLS {
remove(key: string): void;
removeAll(): void;
clear(): void;
resetAllKeys(): [];
resetAllKeys(): string[];
processData(data: any | string, isAllKeysData: boolean): string;
setMetaData(): void;
getMetaData(): { keys: string[] };
Expand All @@ -26,6 +32,7 @@ declare class SecureLS {
DES: CipherHelper;
RABBIT: CipherHelper;
RC4: CipherHelper;
ls: Storage;
enc: {
Latin1: Encoder;
_Utf8: Encoder;
Expand All @@ -38,4 +45,4 @@ declare namespace SecureLS{
encode(e: string);
decode(e: string);
}
}
}
Loading