module Unleash::Strategy::Util

Constants

NORMALIZER

Public Instance Methods

get_normalized_number(identifier, group_id, base = NORMALIZER) click to toggle source

convert the two strings () into a number between 1 and base (100 by default)

# File lib/unleash/strategy/util.rb, line 11
def get_normalized_number(identifier, group_id, base = NORMALIZER)
  MurmurHash3::V32.str_hash("#{group_id}:#{identifier}") % base + 1
end