UNPKG

unleash-server

Version:

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

16 lines 511 B
import { createHash } from 'crypto'; export const scopeHash = (environment, projects) => { let hash = createHash('sha256').update(environment); const wildcard = projects.find((p) => p === '*'); if (wildcard !== undefined) { hash = hash.update('[*]'); } else { const sorted = projects.sort(); sorted.forEach((project) => { hash = hash.update(`[${project}]`); }); } return hash.digest('base64url'); }; //# sourceMappingURL=edge-tokens.js.map