UNPKG

@splitsoftware/splitio-commons

Version:
16 lines (15 loc) 774 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.impressionObserverSSFactory = exports.hashImpression128 = void 0; var ImpressionObserver_1 = require("./ImpressionObserver"); var murmur3_128_x86_1 = require("../../utils/murmur3/murmur3_128_x86"); var buildKey_1 = require("./buildKey"); function hashImpression128(impression) { return (0, murmur3_128_x86_1.hash128)((0, buildKey_1.buildKey)(impression)); } exports.hashImpression128 = hashImpression128; var LAST_SEEN_CACHE_SIZE = 500000; // cache up to 500k impression hashes function impressionObserverSSFactory() { return new ImpressionObserver_1.ImpressionObserver(LAST_SEEN_CACHE_SIZE, hashImpression128); } exports.impressionObserverSSFactory = impressionObserverSSFactory;