lib/unleash/strategy/util.rb in unleash-0.1.5 vs lib/unleash/strategy/util.rb in unleash-0.1.6
- old
+ new
@@ -5,12 +5,12 @@
module Util
module_function
NORMALIZER = 100
- # convert the two strings () into a number between 1 and 100
- def get_normalized_number(identifier, group_id)
- MurmurHash3::V32.str_hash("#{group_id}:#{identifier}") % NORMALIZER + 1
+ # convert the two strings () into a number between 1 and base (100 by default)
+ def get_normalized_number(identifier, group_id, base = NORMALIZER)
+ MurmurHash3::V32.str_hash("#{group_id}:#{identifier}") % base + 1
end
end
end
-end
\ No newline at end of file
+end