Skip to content

Commit

Permalink
Merge ffd1e9d into 101de8a
Browse files Browse the repository at this point in the history
  • Loading branch information
konsultaner committed Apr 3, 2019
2 parents 101de8a + ffd1e9d commit 466201d
Show file tree
Hide file tree
Showing 14 changed files with 2,299 additions and 2,515 deletions.
12 changes: 10 additions & 2 deletions README.md
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
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): string;
decode(e: string): string;
}
}
}

0 comments on commit 466201d

Please sign in to comment.