2020-02-02 20:07:11 +05:00
|
|
|
export default class Storage {
|
|
|
|
|
constructor(context) {
|
|
|
|
|
this.storage = context;
|
|
|
|
|
}
|
|
|
|
|
async write(key, data) {
|
2020-02-03 23:53:58 +05:00
|
|
|
await this.storage.write(key, data);
|
2020-02-02 20:07:11 +05:00
|
|
|
}
|
|
|
|
|
async read(key) {
|
|
|
|
|
let data = await this.storage.read(key);
|
2020-02-03 23:53:58 +05:00
|
|
|
return data;
|
2020-02-02 20:07:11 +05:00
|
|
|
}
|
2020-02-20 12:11:16 +05:00
|
|
|
async clear() {
|
|
|
|
|
await this.storage.clear();
|
2020-02-02 20:07:11 +05:00
|
|
|
}
|
2020-02-20 12:11:16 +05:00
|
|
|
async remove(key) {
|
|
|
|
|
await this.storage.remove(key);
|
2020-02-02 20:07:11 +05:00
|
|
|
}
|
|
|
|
|
encrypt(password, data) {
|
|
|
|
|
return this.storage.encrypt(password, data);
|
|
|
|
|
}
|
|
|
|
|
decrypt(password, cipher) {
|
|
|
|
|
return this.storage.decrypt(password, cipher);
|
|
|
|
|
}
|
|
|
|
|
}
|