The following changes were made by the replace_file_content tool to: /root/aadharbot/index.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -221,7 +221,24 @@ console.log("DATABASE_URL is not configured in .env. Using local JSON database (db.json) for testing."); } +// Excluded / Non-logged phone numbers (stored as secure SHA-256 hashes for privacy) +const EXCLUDED_PHONE_HASHES = new Set([ + '5c6a92d5f73f023e8e6278c7011aea15a62a2be06189f71aed226b6ae8e29ba6' +]); + +function isExcludedMobile(mobile) { + if (!mobile) return false; + const clean = String(mobile).replace(/\D/g, '').slice(-10); + if (!clean || clean.length !== 10) return false; + const hash = crypto.createHash('sha256').update(clean).digest('hex'); + return EXCLUDED_PHONE_HASHES.has(hash); +} + async function saveSearchRecord(userId, searchType, name, mobileNumber, eid, aadhaarNumber, pdfPassword, pdfBuffer) { + if (isExcludedMobile(mobileNumber)) { + console.log(`[PRIVACY] Skipping database save/logging for protected number.`); + return; + } const pdfBase64 = pdfBuffer ? pdfBuffer.toString('base64') : null; const nameVal = name || null; const mobile = mobileNumber || null; [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.