Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from statsig import statsig
from statsig.statsig_event import StatsigEvent
from statsig.statsig_user import StatsigUser
import hashlib
import random
import os

Expand Down Expand Up @@ -37,7 +38,7 @@ def signup():
hash_string = request.remote_addr
if random_num:
hash_string = str(random.randint(0, 1000000))
user_id = str(hash(hash_string))
user_id = hashlib.sha256(hash_string.encode('utf-8')).hexdigest()
statsig_user = StatsigUser(user_id)
statsig_event = StatsigEvent(
user=statsig_user,
Expand All @@ -53,7 +54,7 @@ def get_tasks():
hash_string = request.remote_addr
if random_num:
hash_string = str(random.randint(0, 1000000))
user_id = str(hash(hash_string))
user_id = hashlib.sha256(hash_string.encode('utf-8')).hexdigest()
color = statsig.get_experiment(StatsigUser(user_id), "button_color_v3").get("Button Color", "blue")
paragraph_text = statsig.get_experiment(StatsigUser(user_id), "button_color_v3").get("Paragraph Text", "Data Engineering Boot Camp")
experiment_description = 'odd tasks for blue and green, even for red and orange'
Expand Down