import { createHash } from 'node:crypto'; const hash = (parts) => createHash('sha256').update(parts.join('|')).digest('hex'); export const attestationRkey = ({ subject, service }) => hash([subject, service.type, service.community ?? '', service.identifier ?? '']); export const membershipRkey = ({ attestedBy, service }) => hash([attestedBy, service.type, service.community ?? '', service.identifier ?? '']);