import { createHash } from 'node:crypto'; export function hashHealthImageBuffer(buffer) { if (!Buffer.isBuffer(buffer) || !buffer.length) return null; return createHash('sha256').update(buffer).digest('hex'); } export function hashHealthImageUrl(imageUrl = '') { const raw = String(imageUrl ?? '').trim(); if (!raw) return null; return createHash('sha256').update(raw).digest('hex'); }