2022-02-14 16:15:32 +07:00
|
|
|
"use strict"
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true })
|
2022-02-14 19:05:24 +07:00
|
|
|
exports.Crypto = void 0
|
|
|
|
var Crypto = /** @class */ (function () {
|
|
|
|
function Crypto(provider) {
|
2022-02-14 16:15:32 +07:00
|
|
|
this.provider = provider
|
|
|
|
}
|
2022-02-14 19:05:24 +07:00
|
|
|
Crypto.prototype.encrypt = function (data) {
|
2022-02-14 16:15:32 +07:00
|
|
|
return this.provider.encrypt(data)
|
|
|
|
}
|
2022-02-14 19:05:24 +07:00
|
|
|
Crypto.prototype.decrypt = function (data) {
|
2022-02-14 16:15:32 +07:00
|
|
|
return this.provider.decrypt(data)
|
|
|
|
}
|
2022-02-14 19:05:24 +07:00
|
|
|
Crypto.newInstance = function (provider) {
|
|
|
|
if (!Crypto._instance) {
|
|
|
|
Crypto._instance = new Crypto(provider)
|
2022-02-14 16:15:32 +07:00
|
|
|
}
|
2022-02-14 19:05:24 +07:00
|
|
|
return Crypto._instance
|
2022-02-14 16:15:32 +07:00
|
|
|
}
|
2022-02-14 19:05:24 +07:00
|
|
|
return Crypto
|
2022-02-14 16:15:32 +07:00
|
|
|
})()
|
2022-02-14 19:05:24 +07:00
|
|
|
exports.Crypto = Crypto
|
2022-02-14 16:15:32 +07:00
|
|
|
//# sourceMappingURL=crypto.js.map
|