Example #1
0
def main():
    print('do something here')
    # for loop to 10000 creation of uids in various bases
    for i in range(10000):
        generate()
        generate(2)
        generate(16)
        generate(58)
        generate(64)
Example #2
0
def main():
    for i in range(1000):
        u = generate(base=16)
    
    for i in range(1000):
        u = generate(base=32)
    
    for i in range(1000):
        u = generate(base=64)
Example #3
0
def evaluate(params, is_logged_in, timestamp):
    uid = generate()

    # Select the appropriate download function
    if params['dhtml']:
        download_resources = call_dhtmlget
    else:
        download_resources = call_wget

    start_time = datetime.now()
    download_resources(params, is_logged_in, uid)
    end_time = datetime.now()

    if settings.LOGGING:
        logger.info("Elapsed time for %s download: %s", uid,
                    end_time - start_time)

    start_time = datetime.now()
    pgcount = analyze_resources(params, is_logged_in, uid, timestamp)
    end_time = datetime.now()

    if settings.LOGGING:
        logger.info("Elapsed time for %s analysis: %s", uid,
                    end_time - start_time)

    if not settings.RESOURCES_DEBUG: remove_resources(uid)
    return (pgcount, uid)
Example #4
0
def evaluate_dhtml(params, is_logged_in, timestamp):
    uid = generate()
    request = params['request']
    save_resources(request, uid)

    start_time = datetime.now()
    pgcount = analyze_resources(params, is_logged_in, uid, timestamp)
    end_time = datetime.now()

    if settings.LOGGING:
        logger.info("Elapsed time for %s analysis: %s", uid,
                    end_time - start_time)

    if not settings.RESOURCES_DEBUG: remove_resources(uid)
    return (pgcount, uid)
Example #5
0
def multi_evaluate(params, is_logged_in, timestamp):
    uid = generate()

    # Select the appropriate download function
    if params['dhtml']:
        download_resources = call_dhtmlget
    else:
        download_resources = call_wget

    urls = params['urls'].split()

    start_time = datetime.now()

    for url in urls:
        params['url'] = url
        download_resources(params, is_logged_in, uid)

    end_time = datetime.now()

    if settings.LOGGING:
        logger.info("Elapsed time for %s downloads: %s", uid,
                    end_time - start_time)

    # Cleanup the params dictionary
    del params['url']

    start_time = datetime.now()
    pgcount = analyze_resources(params, is_logged_in, uid, timestamp)
    end_time = datetime.now()

    if settings.LOGGING:
        logger.info("Elapsed time for %s analysis: %s", uid,
                    end_time - start_time)

    if not settings.RESOURCES_DEBUG: remove_resources(uid)
    return (pgcount, uid)
Example #6
0
def store_formid(request):
    formid = generate()
    request.session['formid'] = formid
    return formid
Example #7
0
def main():
    # f = open("uids.txt","w+")

    for i in range(10000):
        generate(2)
Example #8
0
def register(user, password):
	cur.execute('insert into register(user, password userid, time) values("%s", "%s", "%s")' % (user, hashlib(password).hexdigest(),  uid.generate(), time.time()))
	db.commit()
Example #9
0
 def test_two_uids(self):
     u1 = generate()
     sleep(.01)
     u2 = generate()
     time1, time2 = unpack(u1)[0], unpack(u2)[0]
     self.assertLess(time1, time2)
Example #10
0
 def test_unpack_shard(self):
     uid = generate()
     unpacked_shard = unpack(uid)[2]
     self.assertEqual(unpacked_shard, SHARD_ID)
Example #11
0
 def test_unpack_length(self):
     uid = generate()
     self.assertEqual(len(unpack(uid)), 3)