Changed column number to 640
This commit is contained in:
parent
87cb377213
commit
79f94c9e85
|
@ -0,0 +1 @@
|
|||
venv/
|
8
app.py
8
app.py
|
@ -5,7 +5,7 @@ import urllib.parse
|
|||
|
||||
MOD_SIZE = 256
|
||||
table_name = "fingertable"
|
||||
FEATURE_COLS = 200
|
||||
FEATURE_COLS = 640
|
||||
|
||||
engine = create_engine('sqlite:///./cloud.db', echo = True)
|
||||
|
||||
|
@ -15,7 +15,7 @@ app = Flask(__name__)
|
|||
|
||||
@app.route('/validate', methods=['POST'])
|
||||
def validate():
|
||||
user_roll_num = request.get_json()[0]['encr_regno']
|
||||
user_roll_num = request.get_json()['encr_regno']
|
||||
user_roll_num = urllib.parse.quote(user_roll_num)
|
||||
result = engine.execute('SELECT * FROM %s WHERE enc_roll = "%s"' % (table_name, user_roll_num))
|
||||
row = result.first()
|
||||
|
@ -45,7 +45,7 @@ def enroll():
|
|||
enc_features = body['encr_fp_list']
|
||||
enc_sum_of_sqr = urllib.parse.quote(body['encr_fp_sqr'])
|
||||
|
||||
if len(enc_features)!=200:
|
||||
if len(enc_features)!=640:
|
||||
return "Feature count wrong", 400
|
||||
|
||||
insert_query = 'INSERT INTO %s VALUES ("%s", "%s"' % (table_name, enc_user_roll_num, enc_sum_of_sqr)
|
||||
|
@ -60,4 +60,4 @@ def enroll():
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host="0.0.0.0")
|
||||
app.run(host="0.0.0.0")
|
||||
|
|
|
@ -2,7 +2,7 @@ from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String
|
|||
|
||||
MOD_SIZE = 256
|
||||
table_name = "fingertable"
|
||||
FEATURE_COLS = 200
|
||||
FEATURE_COLS = 640
|
||||
|
||||
engine = create_engine('sqlite:///./cloud.db', echo = True)
|
||||
|
||||
|
@ -26,4 +26,4 @@ def add_column(engine, table_name, column):
|
|||
for i in range(FEATURE_COLS):
|
||||
col_name = "enc_f" + str(i)
|
||||
column = Column(col_name, String(MOD_SIZE))
|
||||
add_column(engine, table_name, column)
|
||||
add_column(engine, table_name, column)
|
||||
|
|
|
@ -6,7 +6,7 @@ from random import choice
|
|||
|
||||
MOD_SIZE = 256
|
||||
table_name = "fingertable"
|
||||
FEATURE_COLS = 200
|
||||
FEATURE_COLS = 640
|
||||
|
||||
engine = create_engine('sqlite:///./cloud.db')
|
||||
|
||||
|
|
Loading…
Reference in New Issue