Constructors

Methods

  • Calculates the bucket value for a given string with optional multiplier and maximum value.

    Parameters

    • str: string

      The input string to calculate the bucket value for

    • Optional multiplier: number = 1

      Optional multiplier to adjust the value

    • Optional maxValue: number = 10000

      The maximum value for bucket scaling

    Returns number

    • The calculated bucket value
  • Generates a bucket value based on the hash value, maximum value, and an optional multiplier.

    Parameters

    • hashValue: number

      The hash value used for calculation

    • maxValue: number

      The maximum value for bucket scaling

    • Optional multiplier: number = 1

      Optional multiplier to adjust the value

    Returns number

    • The calculated bucket value
  • Generates the hash value for a given hash key using murmurHash v3.

    Parameters

    • hashKey: string

      The hash key for which the hash value is generated

    Returns number

    • The generated hash value
  • Gets the bucket value for a user based on the hash key and maximum value.

    Parameters

    • hashKey: string

      The hash key for the user

    • Optional maxValue: number = 100

      The maximum value for bucket scaling

    Returns number

    • The calculated bucket value for the user