// What a page's screenshot follows from: its HTML, which carries the // styles and scripts too, less what differs between worlds: DIDs, the // record keys in links to pulls and issues, and the port it is served on. import { createHash } from 'node:crypto' export const digest = (html) => createHash('sha256') .update(html.replace(/did:plc:[a-z2-7]{24}/g, 'did').replace(/127\.0\.0\.1:\d+/g, 'host').replace(/\/[2-7a-z]{13}(?=["/?#])/g, '/rkey')) .digest('hex') /// The path of the social card a page names, which carries a hash of what /// the card shows: all its pixels follow from, but the renderer. export const card = (html) => { const url = html.match(/