2baf29b3ae
Deliver encrypted health zone, observation API, baseline maturity pipeline, page-data bindings, and H5/WeChat channel integration for health P0. Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
398 B
JavaScript
13 lines
398 B
JavaScript
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');
|
|
}
|