From a38b8ca3c6146c2db03167d6ff94e445d756a202 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:09:04 +0530 Subject: Added captha removal and autocomplete to GRN search. --- config/webpack/utils/build-file.js | 19 +++++++++++++++++++ config/webpack/utils/filename-hash.js | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 config/webpack/utils/build-file.js delete mode 100644 config/webpack/utils/filename-hash.js (limited to 'config/webpack/utils') diff --git a/config/webpack/utils/build-file.js b/config/webpack/utils/build-file.js new file mode 100644 index 0000000..9a0ae66 --- /dev/null +++ b/config/webpack/utils/build-file.js @@ -0,0 +1,19 @@ +const crypto = require("crypto"); + +module.exports.getFileName = (fileName, prefix, justHash = false) => { + let hash = crypto + .createHash("md5") + .update(`${prefix}-${fileName}`) + .digest("hex"); + + if (production) { + return hash; + } else { + hash = hash.substring(16); + if (justHash) { + return hash; + } else { + return `${fileName}-${hash}`; + } + } +}; diff --git a/config/webpack/utils/filename-hash.js b/config/webpack/utils/filename-hash.js deleted file mode 100644 index e0d8a6d..0000000 --- a/config/webpack/utils/filename-hash.js +++ /dev/null @@ -1,19 +0,0 @@ -const crypto = require("crypto"); - -module.exports.getFileNameHash = (fileName, prefix, justHash = false) => { - let hash = crypto - .createHash("md5") - .update(`${prefix}-${fileName}`) - .digest("hex"); - - if (production) { - return hash; - } else { - hash = hash.substring(16); - if (justHash) { - return hash; - } else { - return `${fileName}-${hash}`; - } - } -}; -- cgit v1.2.3