From d7dec47de766e724d24401a1063a622e3fd7c371 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 25 Jul 2019 16:48:13 -0400 Subject: [PATCH] Made the UUID a hash of the input instead of random. --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 27b6667..964c49d 100644 --- a/index.js +++ b/index.js @@ -109,7 +109,11 @@ app.get('/api/postVideoSponsorTimes', function (req, res) { startTime = parseFloat(startTime); endTime = parseFloat(endTime); - let UUID = uuidv1(); + //this can just be a hash of the data + //it's better than generating an actual UUID like what was used before + //also better for duplication checking + let hashCreator = crypto.createHash('sha256'); + let UUID = hashCreator.update(videoID + startTime + endTime + userID).digest('hex'); //get current time let timeSubmitted = Date.now();