FlagFix
Feature management

Deterministic bucketing

SHA-256 bucket in the range 0 to 9999.

Cette page n’a pas encore de traduction française. Le texte anglais fait foi.

Last updated on

For a percent strictly between 0 and 100, the server hashes this UTF-8 string with SHA-256:

{projectId}:{environmentId}:{featureKey}:{targetingKey}:{salt}

The first four digest bytes are read as an unsigned 32-bit integer. bucket = that value mod 10000. The user is inside the rollout when bucket < percent * 100.

The same inputs always yield the same bucket. Changing the salt, the feature key, or the environment id reshuffles assignments. An empty targeting key is never inside a partial rollout.

The server computes this bucket. The TypeScript SDK does not recompute it, so a browser and a server request for the same inputs stay aligned.

Cette page vous a-t-elle été utile ?