We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c033936 commit 4e4b60dCopy full SHA for 4e4b60d
internal/utils/hash.go
@@ -14,10 +14,10 @@ func Hash(s string) uint32 {
14
}
15
16
// BuildHash is building the hash based on the different properties of the evaluation.
17
-func BuildHash(flagName string, bucketingKey string, max uint32) uint32 {
18
- // this is not supposed to happen, but to avoid a crash if max is 0 we are returning 0
19
- if max == uint32(0) {
+func BuildHash(flagName string, bucketingKey string, maxPercentage uint32) uint32 {
+ // this is not supposed to happen, but to avoid a crash if maxPercentage is 0 we are returning 0
+ if maxPercentage == uint32(0) {
20
return uint32(0)
21
22
- return Hash(flagName+bucketingKey) % max
+ return Hash(flagName+bucketingKey) % maxPercentage
23
0 commit comments