ngx-monitorias-uniandes-lib
Version:
This library is used for Monitorias-Uniandes system.
31 lines • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var stringify = require("fast-json-stable-stringify");
var sha256 = require("crypto-js/sha256");
var CacheService = /** @class */ (function () {
function CacheService() {
this.cache = new Map();
}
CacheService.prototype.has = function (key) {
return this.cache.has(key);
};
CacheService.prototype.set = function (key, value) {
this.cache.set(key, value);
};
CacheService.prototype.get = function (key) {
return this.cache.get(key);
};
CacheService.prototype.clear = function (key) {
this.cache.delete(key);
};
CacheService.prototype.clearAll = function () {
this.cache.clear();
};
CacheService.prototype.hash = function (input) {
var str_representation = stringify(input);
return eval("0x" + sha256(str_representation).toString() + "n").toString(36);
};
return CacheService;
}());
exports.CacheService = CacheService;
//# sourceMappingURL=cache.service.js.map