UNPKG

@gleif-it/did-webs-ts

Version:
8 lines (7 loc) 299 B
import { createDid } from '../../core/Did.js'; export const generateDid = (host, aid, path = '', port) => { if (!host || !aid) { throw new Error('Host and AID are required'); } return createDid(`did:webs:${host}${port ? `%3A${port}` : ''}${path.replace(/\//g, ':')}:${aid}`); };