UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

14 lines 549 B
import murmurHash3 from 'murmurhash3js'; function normalizedValue(id, groupId, normalizer, seed = 0) { const hash = murmurHash3.x86.hash32(`${groupId}:${id}`, seed); return (hash % normalizer) + 1; } const STRATEGY_SEED = 0; export function normalizedStrategyValue(id, groupId) { return normalizedValue(id, groupId, 100, STRATEGY_SEED); } const VARIANT_SEED = 86028157; export function normalizedVariantValue(id, groupId, normalizer) { return normalizedValue(id, groupId, normalizer, VARIANT_SEED); } //# sourceMappingURL=util.js.map