Skip to content

Updating the forum keys

Edwin Shepherd edited this page Oct 27, 2019 · 3 revisions

Keys were generated for RC 2020 using, to deploy these to the website you will need to ask Brenden (@mrbbot)

from hashlib import md5
from pymongo import MongoClient

client = MongoClient()
codes = client.robocon.codes


def gen_code(team_number):
    return md5(f"RoboCon-Team{team_number}".encode("utf8")).hexdigest()[:8]


def gen_code_object(team_number):
    return {
        "code": gen_code(team_number),
        "school": f"Team {team_number}",
        "competition": "RoboCon 2020",
        "host": "Hills Road",
        "team_number": team_number,
    }


for i in range(1, 26):
    codes.insert_one(gen_code_object(i))
Clone this wiki locally