Sha256: a44ed51793a37b163128295619c8d4525838420871cc167b96a43859aeb4e3d2

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

module SnowplowRubyDuid
  # Generates a pseudo-unique ID to fingerprint the user
  # Deviates from this Snowplow Javascript: https://github.com/snowplow/snowplow-javascript-tracker/blob/d3d10067127eb5c95d0054c8ae60f3bdccba619d/src/js/tracker.js#L468-L472
  #   in order to provide a more unique identifier
  class DomainUserid

    LENGTH_OF_DUID_IN_BYTES = 8

    def initialize
      @domain_user_id = domain_user_id
    end

    def to_s
      @domain_user_id
    end

    private

    def domain_user_id
      SecureRandom.hex LENGTH_OF_DUID_IN_BYTES
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
snowplow_ruby_duid-1.0.0 lib/snowplow_ruby_duid/domain_userid.rb
snowplow_ruby_duid-0.0.1 lib/snowplow_ruby_duid/domain_userid.rb