Skip to content

Commit

Permalink
Add Hashing Capability (SHA1)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmreshSinha committed Feb 8, 2022
1 parent b655632 commit 9c50ecf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const express = require("express");
const redis = require("redis");
const path = require("path");
const crypto = require("crypto");
const cache = require("./src/cache");
const ss = require("./src/puppeteer");

Expand Down Expand Up @@ -183,6 +184,7 @@ app.get("/api", (req, res) => {
// Forming a query string
let query = `${useLink}-${useDimension}-${useDevice}-${useDelay}`;
query = query.replace(/\W/g, "");
query = crypto.createHash('sha1').update(query).digest("hex");

// Checking if the file is in cache or not
cache
Expand Down

0 comments on commit 9c50ecf

Please sign in to comment.