// lib/process/redact.js — passport / national-ID redaction.
//
// Keeps the first 2 and last 2 characters so the document is still traceable
// to the originating intake without containing the full identifier on disk.

export function redactSensitiveId(value) {
  const v = String(value || '');
  if (v.length <= 4) return '****';
  return `${v.slice(0, 2)}${'*'.repeat(Math.max(4, v.length - 4))}${v.slice(-2)}`;
}
