Made the UUID a hash of the input instead of random.

This commit is contained in:
Ajay Ramachandran
2019-07-25 16:48:13 -04:00
parent 71527cc4b1
commit d7dec47de7

View File

@@ -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();