Exemplo n.º 1
0
def getConfidence():
    keyStrokeData = request.json
    data = []
    last_chr = ''
    for event in keyStrokeData['data']:
        if last_chr == '':
            last_chr = chr(event['keyCode'])
        else:
            data.append((last_chr + chr(event['keyCode']), event['flightTime']))
            last_chr = chr(event['keyCode'])

    userstore.createUser(keyStrokeData['userID'], data)
Exemplo n.º 2
0
def getConfidence():
    keyStrokeData = request.json
    data = []
    last_chr = ''
    for event in keyStrokeData['data']:
        if last_chr == '':
            last_chr = chr(event['keyCode'])
        else:
            data.append((last_chr + chr(event['keyCode']), event['flightTime']))
            last_chr = chr(event['keyCode'])
    userstore.createUser(keyStrokeData['userID'], data)
    print data
    au = auth.Authenticator(keyStrokeData['actual_userID'], 25)
    au.initConstWithFullValidation()
    print keyStrokeData['userID']
    return str(au.getLikelihoodFromProfile(keyStrokeData['userID']))